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

Резултати

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

Пребарај: #defitakeover

当前筛选 #defitakeover清除筛选
TON Crypto News

@toncoin_rap · Post #159 · 21.09.2024 г., 06:39

🎧⤴ 🤑TON Ecosystem on Fire! Major Updates from Fintopio, TBook, and XDAO You Can’t Miss This week, the TON blockchain ecosystemrolled out exciting updates across three projects: Fintopio, TBook, and XDAO. Fintopio, one of the fastest-growing DeFi wallets on Telegram, now has 6 million active monthly users, offering fee-free transfers and NFT storage. TBook introduces free TON WISE Credit Scores, encouraging users to showcase their onchain and offchain activities for potential rewards. Lastly, XDAO is pioneering the first DAO ecosystem on TON, integrating Telegram mini-apps and introducing community-driven farming games to attract new users. TON’s rapid growth continues, with a thriving Web3 community ready to reshape digital finance. Chorus: We on TON, leveling up the game, Fintopio's flexin’, ain’t nothin' the same. TBook’s credit stack, XDAO’s on the rise, Decentralized future, right before your eyes. Verse 1: From Telegram straight to the blockchain scene, Fintopio’s the wallet that’s keepin' it clean. Millions logged in, sending cash for free, DeFi on your phone, simple as can be. $HOLD points stackin’, rewards gettin’ high, Move fast, earn big, touch the sky. Security tight, but the game’s still smooth, Digital assets now got nothin' to lose. Chorus: We on TON, leveling up the game, Fintopio's flexin’, ain’t nothin' the same. TBook’s credit stack, XDAO’s on the rise, Decentralized future, right before your eyes. Verse 2: TBook’s in the mix, building up your score, Onchain data, you got rewards in store. Credit's climbing high, opportunity knocks, Show what you’ve done, you control the stocks. Airdrops comin’ in, WISE Credit the key, Exclusive deals, it’s the place to be. You a star on the rise, now the world’s in view, Link up your past, and the rewards come through. Chorus: We on TON, leveling up the game, Fintopio's flexin’, ain’t nothin' the same. TBook’s credit stack, XDAO’s on the rise, Decentralized future, right before your eyes. Verse 3: XDAO’s movin’ fast, DAOs on the map, Farming those coins while you sit back and tap. Mini apps in play, communities grow, TONxDAO tech, let the future flow. Buildin' syndicates, big moves you choose, DAO-based biz, ain’t no time to snooze. Empowerin’ users, decentralize it all, New age of finance, watch the empires fall. Chorus: We on TON, leveling up the game, Fintopio's flexin’, ain’t nothin' the same. TBook’s credit stack, XDAO’s on the rise, Decentralized future, right before your eyes. Bridge: No more middlemen, we takin' control, In the TON ecosystem, we’re playin' the role. From wallets to scores, and DAOs takin' flight, It’s a Web3 revolution, we shine in the night. #TONBlockchain#DeFiTakeover#Web3Revolution #TONCryptoNewsRapStyle 🎧@toncoin_rap