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

Резултати

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

Пребарај: #learnrussian

当前筛选 #learnrussian清除筛选
Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4380 · 21.03.2025 г., 09:30

👋Приветствую! Начнём день с прекрасного? Хрен тебе, а не красивое видео. В доме должна быть одна звезда, и это не ты. Спорим, видео со мной наберёт больше просмотром, чем с тобой? Ну я пошёл... Tough luck, you're not getting a beautiful video. There should only be one star in this house, and it's not you. Bet my video gets more views than yours? Well, I'm off... • На переднем плане (чего? of what? + Genit.) видео/фото/картины [na pi-red-nim pla-ne] In the foreground(of the video/photo/painting) • На заднем плане [na zad-nem pla-ne] In the background(of) #LearnRussian #useful_vocabulary 😎 Stay with @learnRCRussian

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5525 · 07.10.2025 г., 14:00

The "I'm Not Russian, but..." trend is still blowing up on TikTok. 🔻Foreigners keep making vids to Russian songs, trying to sing along to bangers. 🎤🎵How do you like it? #news #learnRussian 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5263 · 13.08.2025 г., 16:30

Alaskans have an interest in Russian culture and language. 🔻The state celebrates Maslenitsa, Easter, and other holidays common in Russia. 🔻Irina, an employee of the state's tourism industry, told RT about this. 🔻According to her, many want to study Russian and for their children to study it, but it is not taught in local schools. Source: rt_russian 📎 Somebody, give them my phone number, please! #learnRussian #news 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4886 · 21.06.2025 г., 10:29

The "I'm Not Russian, but..." trend is still blowing up on TikTok. 🔻Foreigners are making vids to Russian songs, trying to sing along to bangers, especially from Miyagi & Эндшпиль. 🎤🎵The results are on video! #news #learnRussian 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4020 · 13.01.2025 г., 19:16

NATO Secretary-General Mark Rutte has warned EU countries that they will have to learn how to speak Russian in 4-5 years if they do not significantly increase the amount of money that they spend on defense, which currently stands at 2% of GDP. He said this in his speech to the European Parliament in Brussels. "If we do not do this, we will have to start studying Russian in 4-5 years or go to New Zealand," he said. 📎Not that I'm driving at anything but stay with @learnRCRussian and learn some Russian for free with us!😉 Source: TASS Picture: AIшедеврум #news #learnRussian 😎 Subscribe to https://t.me/learnRCRussian

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #6285 · 12.03.2026 г., 10:00

• Секир башка! ⚔️ [si-kir bash-ka] 🔻From Turkic: literally to cut head off- means inevitable punishment (often humorous). 🔻Башка is a pretty rude variant of голова (a head). Example: - Ой, я случайно опубликовал твоё видео на You tube! - Oops, I accidentally posted your video on YouTube! - Секир башка тебе! - Секир башка to you! 💀 #spoken_Russian #LearnRussian 🟠RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4560 · 23.04.2025 г., 19:03

Это могли быть мы, но ты занят(а) своим русским. It could be us but you are busy with studying your Russian. 😴Доброй ночи, товарищи! #just_a_joke #learnrussian 😎RCRussian | Support | Boost

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4248 · 20.02.2025 г., 10:21

Реалистический 🆚️ Реалистичный 🆚️ Реальный 🔢Реалистический [ri-a-lis-ti-chis-kiy] Realistic 🔻This adjective describes something following the principles of realism: • Реалистическая картина [ri-a-lis-ti-chis-ka-ya kar-ti-na] А painting following the principles of realism 🔢Реалистичный [ri-a-lis-tich-nyj] Realistic 🔻It means practical or true to life: • Реалистичный план [ri-a-lis-tich-nyj plan] A practical and achievable plan 🔢Реальный [ri-al'-nyj] Real 🔻It simply means real or existing: • Реальная проблема [ri-al'-na-ya prab-le-ma] Аn actual, existing problem 🎧🗣👇 #tricky_words #learnRussian 😎 Stay with @learnRCRussian

Learn RCRussian🤍💙❤️

@learnrcrussian · Post #4187 · 07.02.2025 г., 19:02

🔻Russian has nuances that are only understandable to native speakers or advanced language learners. A kind of secret code:). The meaning of a sentence can even depend on intonation. 🔻The words in these sentences might seem identical, but the meaning is completely different! 1.Не надо меня уговаривать. [ni na-da mi-nya u-ga-va-ri-vat'] I don't agree, and persuasion won't work. 2. Меня не надо уговаривать. [mi-nya ni na-da u-ga-va-ri-vat'] No need to persuade me, I agree. 😎С пятницей, товарищи! #tricky_words #learnRussian 😎RCRussian | Support | Boost

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5648 · 05.11.2025 г., 13:00

• Заначка (заначки) (femjn.noun) [za-nach-ka (za-nach-ki)] 🔻It's more than just savings – it's a secret stash for a rainy day, your personal hidden reserve. 🔻The word comes from the colloquial verb: • Заначить (perf.) [za-na-chit'] To hide, to stash away 🔻In the past, people hid money in boots, under floorboards, or in books. Today, the hiding spots are just as creative (and unpredictable!). So, where would your cat hide its заначка? #useful_vocabulary #spoken_Russian #LearnRussian 😎RCR | Support | Boost

Learn RCRussian🤍💙❤️

@learnRCRussian · Post #5627 · 31.10.2025 г., 07:43

🎃 Russia's Ancient "Halloween" 🔻While the world celebrates Halloween on October 31st, Slavic pagans once marked ▶️Велесова Ночь (Veles Night) – the night when the veil between the world of the living and the world of the dead was believed to be the thinnest. 🔻However, there is a modern, folk-humorous name for Halloween in Russia. It was coined by analogy with the traditional Orthodox holidays like Яблочный Спас (Apple Spas). It perfectly captures the Russian tendency to adapt a foreign holiday with a familiar, often agricultural, name: • Ты‌квенный Спас [ty-kvin-nyj spas] Pumpkin Spas (Saviour) 🔻So, if you find yourself in Russia tonight instead of celebrating Halloween, be sure to celebrate Тыквенный спас! (Especially since there have been discussions about potentially banning Halloween officially due to its satanic atmosphere). 🔻ТыквенныйСпас is considered to be about cooking pumpkin dishes, home decorations, pumpkin games and festive gatherings. This wholesome family holiday offers a Russian alternative to Western Halloween! 🎃Enjoy your pumpkins the Russian way! Happy holiday!Всех обняла! #Russian_culture #holidays #LearnRussian 😎RCR | Support | Boost

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