TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #205 · 22 јан.

Как работает функция reload()? Эта функция нужна для того, чтобы перезагрузить изменившийся код из py-файла без рестарта интерпретатора. Дело в том, что любой импортированный модуль при повторном импорте не будет перечитывать файл. Функция импорта вернёт уже загруженный в память объект модуля. Чтобы обновить код, нужно либо перезапустить всю программу, либо использовать функцию reload() from importlib import reload reload(my_module) 🔸 Функция reload() принимает в качестве аргумента только объект модуля или пакета. Она не может перезагрузить класс или функцию. Только весь файл целиком! 🔸 Перезагрузка пакета перезагрузит только его файл __init__.py, если он есть. Но не вложенные модули. 🔸Она не может перезагрузить ранее не импортированный модуль. 🔸При вызове функция reload() перечитывает и перекомпилирует код в файле, создавая новые объекты. После создания новых объектов перезаписывается ранее созданный неймспейс этого модуля. Это значит, что если где-то этот модуль импортирован через import и обращение к атрибутам происходит через неймспейс (имя) модуля, то такие атрибуты обновятся. Если какие-либо объекты из этого модуля импортированы через from то они будут ссылаться на старые объекты. Напишем простой модуль # mymodule.py x = 1 Теперь импортируем модуль и отдельно переменную х из модуля >>> import mymodule >>> from mymodule import x >>> print(mymodule.x) 1 >>> print(x) 1 Не перезапуская интерпретатор вносим изменения в модуль # mymodule.py x = 2 Делаем перезагрузку модуля и проверяем х ещё раз >>> reload(mymodule) >>> print(mymodule.x) 2 >>> print(x) 1 То же самое будет если присвоить любой объект переменной (даже словарь или список) Повторный импорт обновляет значение >>> from mymodule import x >>> print(x) 2 🔸Созданные инстансы классов не обновятся после перезагрузки модуля. Их придётся пересоздать. #tricks#basic

Резултати

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

Пребарај: #yangiyul

当前筛选 #yangiyul清除筛选
EKOLOG.UZ| ENG

@ekologuzenglish · Post #12446 · 19.04.2026 г., 14:26

#Yangiyul Animals in the municipal veterinary service are dying without access to food and water A situation causing serious concern among animal rights activists and the public has been reported in the city of Yangiyul. According to them, an institution that is supposed to provide care and treatment for animals has become the center of a scandal due to improper conditions in its quarantine facility. Reports indicate that animals in the isolation unit are being kept without access to food and water. Of particular concern is an injured dog that urgently requires veterinary care. However, activists claim that no necessary treatment or care is being provided. Elena Vladimirovna Babenko, a member of the Public Council under the National Committee on Ecology and Climate Change, contacted the Veterinary Committee’s hotline (71 202 12 00, ext. 201). She was informed that the situation would be reviewed and appropriate measures would be taken. Despite these assurances, volunteers say that no changes have occurred on site. A volunteer named Asiya attempted to deliver medication, water, and food for the animals, but was denied access to the facility. Animal rights activists insist on an urgent inspection by the relevant authorities and a legal assessment of the situation. ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube.

Hashtags

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11615 · 15.02.2026 г., 14:59

🚨 Lawlessness or rule of law? A zoo volunteer’s home attacked in Yangiyul The conflict between animal rights defenders and the animal control service has escalated into open confrontation. According to volunteers, the situation has already gone beyond legal boundaries and is infringing on fundamental civil rights. Animal welfare activists Asiya Abuzyárova and Svetlana Velichko reported that about 30 dogs disappeared from the territory of a municipal improvement enterprise. After attempts to return the animals, pressure reportedly began: a complaint was filed with the police, a volunteer was attacked, her phone was broken, and activists were allegedly harassed. ❗️ The most serious incident was the forced entry into a private home. According to reports, municipal workers used a ladder to break a window and enter Asiya Abuzyárova’s house, forcibly removing the animals inside. When the homeowner resisted, her phone was destroyed and her hand was injured. ⚖️ According to the legislation of Uzbekistan: 🔹 The home is inviolable — entry without the residents’ consent is allowed only on legal grounds or by court order. 🔹 Private property is protected by the state — damage to property and unlawful seizure are prohibited. 🔹 Any actions by officials must have legal grounds and be properly documented. This may constitute unlawful entry into a residence, abuse of authority, and violation of citizens’ rights. 📢 Key questions arise: ✔️ On what legal basis were the animals seized? ✔️ Who authorized the entry into the home? ✔️ Why are reports of property damage and injuries being ignored? The law must apply equally to everyone — both citizens and officials. The situation requires a transparent investigation and a legal assessment of the actions of all parties. #Yangiyul#civilrights#animalprotection#ruleoflaw ☘️ Follow the latest environmental news on @ekologuz. Send your suggestions and feedback via @eklguz_bot

EKOLOG.UZ| ENG

@ekologuzenglish · Post #11606 · 14.02.2026 г., 08:03

🐾 Where are the dogs disappearing in Yangiyul? At the temporary dog holding center (shelter) in Yangiyul, on February 10, volunteers recorded the dogs in the shelter. According to the volunteers, almost no adult dogs remained — all of them were reportedly killed overnight. A day earlier, many dogs were in the shelter, but when the volunteers visited, they saw only 5–6 dogs in the cages. The question is: where did the rest of the dogs go? Volunteers say they were killed. According to the volunteers, tomorrow the remaining poor dogs on Persidskaya Street — who are already afraid of every little sound — are also scheduled to be killed. 💔 This is not just statistics. This is a matter of our humanity. #ProtectAnimals#Yangiyul#AgainstCruelty#Ethics#Animals ☘️Read the latest environmental news on the @ekologuz page. Follow us and send your suggestions and wishes via @eklguz_bot Instagram | Facebook | Twitter | Sayt | Youtube