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

Резултати

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

Пребарај: #weird

当前筛选 #weird清除筛选
Journey to Fluency

@fluencyinenglish · Post #7334 · 21.09.2019 г., 18:51

#weird-truth @fluencyinenglish 🔹Old Funeral Customs: Placing Coins on the Eyes of the Dead @fluencyinenglish At Stillinger Family Funeral Home in Greenfield, Indiana, we get questions all the time about old funeral customs like this one: What’s the meaning of placing coins on the eyes of the dead? Like many customs and traditions, this one goes way back – in this case to the times of Greek mythology. Placing coins on the eyes of the dead was intended to “pay the ferryman”. Let’s take a closer look at this old funeral custom: ❇️Paying the Ferryman @fluencyinenglish According to often accepted interpretations of Greek mythology, it was essential to pay the ferryman. What does this mean? Charon was the name of a mythological boatman who would transport the souls of the departed across the River Styx; in essence, this was a journey from the land of the living to the land of the dead. To ancient Greeks and others, not making this journey meant not passing on to the afterlife, but instead remaining behind to wander the banks of the River Styx. Because Charon needed to be paid for the journey, coins were placed on the body. @fluencyinenglish In the Mouth or On the Eyes? It appears the earliest manifestations of paying the ferryman called for placing a single silver or gold coin under the tongue of the dead. This was called Charon’s Obol (the obolus was a silver coin in ancient Athens, Greece). The custom eventually came to include the alternative practice of placing a coin ON the mouth of the deceased, as opposed to under the tongue. @fluencyinenglish It is not exactly clear when the tradition evolved to include the practice of placing two coins on the eyes of the departed. Modern iterations of this practice may call for placing pennies or quarters on the closed eyes. It is also believed that placing coins on the eyes of the dead was historically done to make sure the eyes remained closed – out of the superstitious fear that looking into the eyes of the deceased would reveal our own death. @fluencyinenglish From Timeless Traditions to Modern Funeral Services While many old funeral traditions – such as placing coins on the eyes of the dead – may be regarded as outmoded superstitions with no basis in fact or science, many people still regard them as comforting customs to help them find peace with the passing. @fluencyinenglish

Hashtags

Страхи мужика

@waitmanfear · Post #2407 · 19.02.2023 г., 10:50

Графический дизайнер Роб Шеридан показал нью-йоркскую неделю высокой моды в стиле «вечно мучающихсядемонов ада, на которых садистски вырезаны произведения боди-арта, пропитанные кровью». Ужасно-прекрасно r/#weird

Hashtags