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 слични објави

Пребарај: #uncertainty

当前筛选 #uncertainty清除筛选
IELTS|Newspapers & Magazines|English

@emagzinewspars · Post #9736 · 18.12.2025 г., 15:35

#MIT_Sloan_Management_Review🇺🇸📕[PDF]⬇️ #Winter2026 #Monthly_Magazines For learning, for free(dom). @backupofmagazines This issue explores how leaders can turn volatility into advantage by treating #Uncertainty not as a threat but as a strategic resource. The issue’s cover package on #StrategicForesight shows how scenario planning, analogical thinking, and long-term perspective help organizations navigate an #AI-driven world. Essays on #AuthenticLeadership question whether “being yourself” builds trust or excuses bad behavior, while deep dives into #AlgorithmicPricing and #ResponsibleAI highlight rising legal and ethical risks. Across strategy, innovation, and #Sustainability, the message is clear: progress comes from disciplined adaptation, not endless upheaval.

Crypto M - Crypto News

@CryptoM · Post #65043 · 10.04.2026 г., 15:45

🚀 U.S. Prepares Military Response Amid Iran Peace Talks, Says Trump U.S. President Donald Trump has stated that if peace negotiations with Iran fail, American warships are being equipped with advanced ammunition to resume strikes. According to Odaily, Trump's comments came shortly before U.S. Vice President Vance boarded Air Force Two en route to Islamabad for peace talks with Witkoff and Kushner. In a phone interview, Trump expressed uncertainty about the success of the negotiations, saying, "We will know in about 24 hours. We are rearming our ships with the finest ammunition and the most advanced weapons, even better than what we used before, which had already defeated them. If no agreement is reached, we will use them very effectively." Trump further commented on the unpredictability of the situation, stating, "We are dealing with people whose honesty is uncertain. They claim to abandon all nuclear weapons in front of us, but then tell the media they want to enrich uranium. We will find out the truth." #US#Trump#Iran#MilitaryResponse#PeaceTalks#Ammunition#Warships#NuclearWeapons#Uncertainty#Diplomacy#Pakistan#AirForceTwo

Crypto M - Crypto News

@CryptoM · Post #64734 · 09.04.2026 г., 16:31

🚀 Uncertainty Surrounds Trump's Attendance at Mar-a-Lago Gala Terms for the April 25 official gala at Mar-a-Lago indicate that U.S. President Donald Trump may not be able to attend, and organizers reserve the right to reschedule or cancel the event. According to NS3.AI, a spokesperson from Get Trump Memes stated that Trump is still anticipated to attend both the Florida luncheon and the White House Correspondents' Dinner in Washington that evening. #Trump#MarALago#gala#uncertainty#attendance#reschedule#cancel#floridaluncheon#whitehousecorrespondentsdinner#NS3AI#GetTrumpMemes