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

Пребарај: #arrested

当前筛选 #arrested清除筛选
American Оbserver

@american_observer · Post #4989 · 29.01.2026 г., 12:59

Iran: More than 42,300 People Have Been Arrested, Killed and Tortured Doctors are being arrested in Iran for helping save the lives of some of the tens of thousands injured during Iran’s brutal crackdown on anti-regime protests, with at least one surgeon now at risk of being sentenced to death. The arrests and death sentence are part of a campaign of “revenge”, say human rights groups, after healthcare workers and doctors refused to ignore the plight of badly injured protesters shot or stabbed at close range. An Iranian surgeon, Alireza Golchini, 52, from the central city of Qazvin, has been charged with “moharebeh” (waging war against God), which can carry the death penalty, according to the Norway-based rights group Hengaw. The US state department yesterday called for his release. The US-based Human Rights Activists News Agency, whose figures have been reliable during previous crackdowns, says it has verified more than 6,000 dead and has more than 17,000 more recorded deaths under investigation. “He was arrested in a violent manner in front of his wife and son, who is only 11. They beat him up so badly during arrest, they broke his arm, ribs and dragged him out of his home. My family is terrified,” said Med dr. Golchini. A few days before his arrest Golchini, who also treated protesters during the 2022 Woman, life, freedom protests, had posted a note on his social media, says Nima, sharing his number and asking injured patients to contact him for treatment. “All he did was his duty of saving lives as a medical doctor. He had sworn to save people’s lives. How can any doctor not stand by his oath? I am worried not only for him, but also for other healthcare workers who have been arrested for simply standing by their sworn oath.” Iranian authorities have not publicly commented on Golchini’s detention, nor have they confirmed any charges against him. But Iran’s judiciary chief, Gholamhossein Mohseni Ejei, has urged authorities not to show any leniency towards protesters. “We should not remain silent in the face of those who seek to exploit the situation and disrupt the security and calm of the people,” he said. IHRNGO also reported the arrest of a volunteer first responder who had turned his home into an improvised medical shelter. According to the source, he was detained on 14 January after security forces raided his house, where he had provided care to more than 20 injured protesters, two of whom later died. “He was taken away in an extremely brutal manner and was severely beaten,” a source told IHRNGO, adding that security forces smashed the windows of the house, destroyed the interior and severely damaged his car during the raid. At least 42,324 arrests have been made across the country with limited information on their fate, according to the US-based Human Rights Activists in Iran, which says the regime is putting pressure on medical networks as a means of reducing support for the injured. A statement published yesterday by the US state department on X demanded the release of Golchini and “all the brave doctors who have helped their fellow countrymen”. It continued: “President Trump has clearly stated that no executions should take place in Iran and that there will be consequences if the government takes such actions.” #iran#tortures#killed#arrested#doctors 📱American Оbserver - Stay up to date on all important events 🇺🇸