TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #197 · 4 јан.

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в 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

Hashtags

Резултати

Пронајдени 240 слични објави

Пребарај: #uae

当前筛选 #uae清除筛选
Ultimora.net - POLITICS

@ultimoraPOLITICS · Post #39339 · 13.05.2022 г., 13:56

#UAE Il Presidente degli Emirati Arabi Uniti Khalifa bin Zayed Al Nahyan è morto oggi all'età di 73 anni. In carica dal 2004, Khalifa è morto dopo una lunga lotta contro una malattia grave. La Presidenza del Consiglio ha annunciato che osserveranno 40 giorni…

Hashtags

Ultimora.net - POLITICS

@ultimoraPOLITICS · Post #39338 · 13.05.2022 г., 13:47

#UAE Il Presidente degli Emirati Arabi Uniti Khalifa bin Zayed Al Nahyan è morto oggi all'età di 73 anni. In carica dal 2004, Khalifa è morto dopo una lunga lotta contro una malattia grave. La Presidenza del Consiglio ha annunciato che osserveranno 40 giorni di lutto. @UltimoraPolitics

Hashtags

Islamic World News

@iswnews_en · Post #17760 · 27.03.2026 г., 14:15

🇦🇪🌪After Iran now the mother nature is pounding the UAE! The earth too abhors those whose hands, alongside Israel, are stained with the blood of children. #UAE

Hashtags

International Geographic

@internationalgeographic · Post #5730 · 09.06.2025 г., 06:23

Al Ain, #UAE🇦🇪 The oasis city of Al Ain is the fourth largest city in the country and the only major city located far from the sea. In fact, the Emirates began with him. Al Ain is known primarily for the fact that the Sheikh Zayed was born and lived here, thanks to whom the Emirates began to actively develop. In addition, it is here that most of the country's indigenous people live. You can travel to Al Ain from Abu Dhabi and Dubai either on your own or with an excursion.

Hashtags

POPULAR FRONT

@popularxfront · Post #5399 · 13.03.2026 г., 10:51

🇦🇪#UAE: Explosions were reported in Dubai's business district. Footage shows a large cloud of smoke rising from the central area of the financial hub. Some reports mention that one of the buildings was struck after UAE air defence shot down several Iranian drones. (📹 via AFP & @MofaYasir on X)

Hashtags

Dan Kovalik

@danielmkovalik · Post #3036 · 29.11.2025 г., 19:05

The United Arab Emirates Use a Black Sport to Whitewash a Genocide in Africa #UAE @NBA @ESPN https://www.blackagendareport.com/united-arab-emirates-use-black-sport-whitewash-genocide-africa

Hashtags

uzsd.uz channel

@uzsduz · Post #2211 · 03.08.2022 г., 06:06

#UAE Часть 5 Путешествие по ОАЭ Дубайская рамка *** 5-qism BAA bo‘yicha sayohat Dubay ramkasi 👇Подписаться на канал👇 https://t.me/uzsduz

Hashtags

uzsd.uz channel

@uzsduz · Post #2209 · 01.08.2022 г., 08:21

#UAE Часть 4 Путешествие по ОАЭ *** 4-qism BAA bo‘yicha sayohat https://m.facebook.com/story.php?story_fbid=pfbid0PFCU8JbuaHioaFBNPGuyX1riG4D6wSkSfbg6mMcAgdmqZtnSZDQY65rwTVBDFu7Rl&id=100000049131167 👇Подписаться на канал👇 https://t.me/uzsduz

Hashtags

uzsd.uz channel

@uzsduz · Post #2196 · 31.07.2022 г., 17:23

#UAE Часть 3 Путешествие по ОАЭ *** 3-qism BAA bo‘yicha sayohat 👇Подписаться на канал👇 https://t.me/uzsduz

Hashtags

uzsd.uz channel

@uzsduz · Post #2195 · 30.07.2022 г., 08:45

#UAE Часть 2 Путешествие по ОАЭ *** 2-qism BAA bo‘yicha sayohat 👇Подписаться на канал👇 https://t.me/uzsduz

Hashtags

123•••10•••1920
ПретходнаСтраница 1 од 20Следна