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

Резултати

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

Пребарај: #fine

当前筛选 #fine清除筛选

​​🎙 INVEST REPORT Announce #FINEproject update #FINE is Trending first in Dextool. Reaching out Millions of investors. 👉 Order dextool Trend starting with 6500$ per 24 hours 1️⃣ Dextool trending working 2️⃣ Big marketing Campaign incoming 3️⃣ Reached 30 mil mcap 🔜 50 Mil $ Mcap We announced at 9 mil $ Mcap. We just hit 30mil $ mcap and we are getting closer to 100,000,000 Mcap. At the moment we made for you 230% Profit ⚠️Always do your own research and due diligence when considering your participation in any blockchain project.

Hashtags

​​🎙 NEW GEM #FINE I think here is big potential to grow, marketing incoming. 🆘Be careful, put small bag here. Marketcap: 9.5 MIL $ Price now: 0.000000023618598849591634 $ 1️⃣Dextool trending working, order Dextool Trending 2️⃣Big marketing Campaign incoming ✅ More information Telegram: https://t.me/+YIevhi57q2phY2Y6 Website:https://www.finerc.vip/ 👉 BUY HERE: https://www.dextools.io/app/en/ether/pair-explorer/0xb54ce26f2e30f64c5b684b141311ce138ab5e00e 🧨 Push cooperating with@Whales100xsignals #MEMECOIN#GEM

NIDO Russia (НИДО)

@nido_russia · Post #1923 · 11.12.2024 г., 09:54

The increase in fines for a number of traffic violations will come into force on January 1, 2025 📌"In Article 2, the word" Law "should be replaced with the words "Federal Law", the words "after thirty days from the date of its official publication" should be replaced with the words "from January 1, 2025," the text of the amendment posted in the Duma electronic database says. 📌Under this law, failure by a driver to perform the duty to insure his civil liability, as well as driving a vehicle, if the Compulsory third Party Insurance (CTP) policy is deliberately absent, entails the imposition of an administrative fine in the amount of 800 rubles. 📌Earlier, the Parliament of the Kabardino-Balkar Republic submitted to the State Duma a bill that proposes to establish a fine for repeated violation of the Administrative Code of the Russian Federation, namely the absence of a driver's CTP policy, up to 5 thousand rubles. CTP policy means Compulsory Third Party Insurance Policy #news#russia#nido_russia#traffic#fine#regulations https://t.me/nido_russia