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

Резултати

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

Пребарај: #karagarga

当前筛选 #karagarga清除筛选
PT资讯频道

@PrivateTrackerNews · Post #773 · 03.08.2019 г., 16:27

#Karagarga (KG) Donations (2019) We have now collected all the funds required. Donations are closed again until 2020. Thank you for your contributions. We've also handed out all donor stars. If we missed you through administrative oversight, please contact ***. 捐款(2019年) 我們現在收集了所需的所有資金。 捐款將再次關閉,直到2020年。 感謝您的貢獻。 我們還發放了所有捐贈明星。 如果我們通過行政監督錯過了您,請聯繫***。

Hashtags

PT风向旗

@Ptfxq · Post #375 · 14.10.2022 г., 22:00

#karagarga#KG The Pot The pot system has been functioning well for more than a decade now, big thanks to all subtitlers and pledgers. Please check if you have claimed any pots. Go to your profile, and after Pot Pledges click on (claimed pots). If you are working on a pot, leave a comment there about progress, and update that post at least every 3 months. If not, cancel your claim. A dormant claim can discourage a potential subtitler. Also, please keep an eye from time to time on pots you started or pledged to (see Pot Pledges in your profile). If good subtitles appeared in the meantime, report that pot with a link to the subs. If you want to subtitle a film for which the pot has been claimed long ago without any news, please contact one of us (corvusalbus, flipflink, cyzs, musiclova). Happy subtitling and viewing!

PT风向旗

@Ptfxq · Post #279 · 28.07.2022 г., 23:35

#KaraGarga#KG#开放捐赠 2022-07-26 Annual Donations (2022) Dear all, we've to collect donations for server / hosting expenses for the year ahead. Please contact stefflbw by pm if you can contribute this year. If you have donated in 2020 or 2021 you can follow the same link / method. In that case please PM stefflbw (with the transaction details) when the donation is complete. If you do not wish to have a donor star activated beside your profile name, please let us know. "What is a suitable amount?" is a frequently asked question. Donations between $10 and $50 have been the most typical. Occasionally members have donated substantially more but the bulk of the annual bill is generally financed by a high number of "smaller" donations. We will post regular updates on the donations total percentage below. Thank you, the KG jungle gym team

PT风向旗

@Ptfxq · Post #926 · 16.08.2025 г., 16:00

#KaraGarga#KG#开放捐赠#慢讯#群友投稿 只是年度捐赠,没有捐入 Dear all, we are commencing our annual donations drive. The funds collected will cover server / hosting expenses from September 2025 to September 2026. How much might a member donate? A typical donation amount in previous years was $10 to $50. A few members have donated substantially more but the bulk of our funds is collected through a higher volume of typical donations. If you have the opportunity to donate in 2025, please PM () for instructions. (If you have donated previously, the instructions have not changed) Much love from The Crow Sanctuary boffins. Target percentage: Aug 3: 17% Aug 4: 28% Aug 5: 37% Aug 6: 47% Aug 7: 56% Aug 8: 69% Aug 9: 74% Aug 10: 77% Aug 11: 80% Aug 12: 85% Aug 14: 87% Aug 15: 90%