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

Резултати

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

Пребарај: #cfc

当前筛选 #cfc清除筛选
CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #177022 · 29.04.2026 г., 14:36

🚨 Chelsea are now looking at a list of around 7 or 8 names to take over permanently. One of those under consideration is Iraola. After hiring and firing 4 permanent coaches in as many years, the club do not want to rush this decision. (Simon Johnson Sport) #CFC

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #177017 · 29.04.2026 г., 09:34

🚨 BREAKING: Chelsea captain Millie Bright has retired from football with immediate effect after 12 years, 314 appearances and 20 trophies. Bright will be staying on at the club as a trustee of the #CFC Foundation and starting a new role as a Chelsea ambassador. 🗣️ Bright: “Representing Chelsea over the last 12 years has been everything to me, but I'm now ready to say goodbye to playing football. I’ve given all I can, and I never wanted to fight for any other badge. “It’s now time, and I'm ready to go into a new era. I’m always going to be Chelsea, but just in a different way.” Chelsea will mark Bright’s retirement on May 16 at their final WSL game of the season against ManchesterUnited. 🔗 Ben Jacobs

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #177016 · 29.04.2026 г., 09:33

🚨🇸🇳 Juventus are monitoring Nicolas Jackson, and can imagine a loan move for him. AC Milan are also monitoring. (Plettigoal) #CFC

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #176983 · 27.04.2026 г., 07:31

🚨 Joe Cole tells Frank Lampard to stay away from Chelsea job: "Frank should stay away from it. The temptation for Frank, because he loves the club, would be to come back and give it another whirl." "If I was him, I wouldn’t go to Chelsea. In any job, you’re being judged on your results but [at Chelsea] you don’t have full control over what you can do. That’s insane." #CFC

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #176957 · 26.04.2026 г., 10:43

🚨🇪🇸 Andoni Iraola would be more than happy to continue in the PL. He would be KEEN on becoming the next Chelsea manager! Nothing decided by Chelsea as in the early stages and nothing advanced. (Fabrizio Romano) #CFC

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #176753 · 16.04.2026 г., 14:57

🚨BREAKING: Moises Caicedo to sign new Chelsea contract. [Via telegraph] 🚨🔵 BREAKING: Chelsea are closing in on new deal for Moisés Caicedo! The agreement will be valid until June 2033 with final details being sorted, as @CLMerlo reports. Caicedo has given green light to #CFC stay for long term. [Via Fabrizio Romano]

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #176641 · 09.04.2026 г., 21:14

🚨 Breaking: Morgan Rogers likely to leave this summer even if Aston Villa get UCL. Chelsea, Arsenal, Liverpool, Utd are interested. £80m is the starting point figure for negotiations. #CFC looking for an attacker who can play off the left or central. [Via Ben Jacobs]

Hashtags

CHELSEA NEWS 🗞️ 🔵

@Chelsea_fc_worldwide · Post #176257 · 18.03.2026 г., 19:48

🚨 Fabrizio Romano: "There is something happening behind the scenes. My understanding is that there has been a conversation for some months between Enzo Fernandez and Chelsea to try to find a solution over contract terms to try to adjust the contract. At the moment, still no agreement." "If they can't find a solution, which I'm sure they will try to, Enzo could be open to exploring options in the summer." #CFC

Hashtags

ПретходнаСтраница 1 од 5Следна