Подразумеваемые неймспейсы или неявные пакеты.
Этот функционал добавлен в Python 3.3
Что он означает?
Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py.
Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета".
Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта.
Конечно, не любую в файловой системе, а только те что находятся в sys.path.
Это значит, что теперь __init__.py нужно делать только если:
🔸 вам требуется создать код инициализации пакета
🔸 нужна совместимость со старыми версиями Python
На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего.
Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов.
repo_name/
my_library/
__init__.py
main.py
examples/
exam1.py
exam2.py
В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет.
Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет!
#basic#pep
The RKM 740 Tower.
Architecture studio J Mayer H has completed a mixed-use tower in Düsseldorf, Germany, with profiled metal cladding that opens up like a zipper to provide views through its glazed facades.
J Mayer H won an international competition in 2011 to design the tower, which contains several medical facilities and apartments on the former grounds of the Dominikus-Krankenhaus hospital.
#architecture#arch_shovel#archdaily#NewsArchitecture
Silicon Valley.
Nearly 10 years in the making and the team of 1000+ designers, inventors, programmers, & builders can finally celebrate Google’s first ground-up campus! ⠀
Architecture: BIG
Location: Silicon Valley, California
#arch_shovel#architecture#NewsArchitecture#big
Bridge of spheres.
A futuristic bridge will appear in the Moscow City business center. The project was developed by the chief architect of Moscow Sergey Kuznetsov and architect Dmitry Sukhov.
#arch_shovel#architecture#NewsArchitecture#Кузнецов_проекты
Vltava Philharmonic Hall by Mecanoo.
The competition entry of Vltava Philharmonic Hall, a new musical and cultural center located in the heart of Prague.
Architecture: Mecanoo collaboration with Chybik+Kristof
Image: by Plo.mp, Mangoshake studio and Mecanoo
#NewsArchitecture#News#Architecture#arch_shovel#competition
The proposal for the Philharmonic Hall in Prague by Henning Larsen.
The new Prague Vltava Philharmonic will be the perfect ‘instrument’ - an expression of this place - realized in a new artistic language. Its cresting spires play in harmony with the towers, turrets, steeples and spires that grace the tapestry of the city’s roofscape.
Architecture: Henning Larsen
#danisharchitecture#arch_shovel#NewsArchitecture#competititon#architecture
Philharmonic Hall in Prague by Ludgaard & Tranberg.
Ludgaard & Tranberg’s design proposal created in collaboration with Cobe Architects for the Vlatava Philharmonic Hall in Prague. Music, art, architecture, the city and the audience converge in a concert hall that extends its vibrations far beyond the site by the river Vltava.
Architecture: Ludgaard & Tranberg & Cobe Architects
Acoustics: Gade & Mortensen Akustik
Consultation: Tyrens
#danisharchitecture#arch_shovel#NewsArchitecture#competititon#architecture
The project of a new residential complex in Moscow was approved.
The main design element is small balconies, which resemble a skin of the fantastic animal.
Architecture: “LABVA PRO” LTD bureau and “Architectural Bureau of Katerina Gren”.
#arch_shovel#architecture#moscow#residential#complex#new#NewsArchitecture
The Vltava Philharmonic Hall.
The new Vltava Philharmonic will be built by the Danish architectural studio Bjarke Ingels Group (BIG).
BIG plans to complete the new building in 2032.
“The Vltava Philharmonic Hall is composed as a meandering journey from riverbank to rooftop. Public flows and belvedere plazas unite the city life of Prague to the music within. Its halls are formed for sight, fine-tuned for sound, and orchestrated for functionality and connectivity. From this rhythmic structure, a symphony of colonnades and balconies extend as platforms for public life. Expressive yet pragmatic, the new Philharmonic will ascend to form a key landmark for Prague - from river to roof.” Bjarke Ingels, Founder & Partner, BIG.
#arch_shovel#conpetition#award#cultural#BIG#news#NewsArchitecture
The Shanghai Lingang Special Area master plan.
Design: Ennead Architects
Location: Shanghai, China
Ennead Architects has designed the Shanghai Lingang Special Area master plan (a new hub for global commerce) around the central axis that defines the Dishui Lake district in Shanghai.
One of the key features of the Shanghai Lingang Special Area will be “The Ring”. This circular, cantilevered observation deck, and museum will afford 360-degree views of nearby Dishui Lake, Shanghai and the Pacific Ocean.
The two towers flanking the Ring (The Tower Waterfall and Tower Rhomboid) are designed to become two of the most easily recognizable features of the new business district. Similar in scale, the towers have distinct identities.
#Architecture#arch_shovel#NewsArchitecture#News#Shanghai#China#Masterplan#CityPlanning#OfficeBuilding#CommercialArchitecture#UrbanDistrict#UrbanDesign