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

Пребарај: #privacylaw

当前筛选 #privacylaw清除筛选
AI & Law

@ai_and_law · Post #643 · 26.08.2025 г., 07:04

🇺🇸Otter.ai Faces Class Action Over Voice Data and AI Training A lawsuit filed in California alleges that Otter.ai violated the U.S. Electronic Communications Privacy Act, the Computer Fraud and Abuse Act, and multiple California statutes by recording individuals’ voices without consent and using them to train its AI models. The complaint, led by Justin Brewer, emphasizes that while Otter users may accept recordings, non-users—who are not asked for permission—are also captured, raising broader legal and ethical concerns. The case highlights a growing fault line: enterprise transcription and note-taking apps like Otter.ai, Read.ai, and Google Gemini are designed for convenience, yet their silent background operation may expose organizations to litigation. With over 100 potential plaintiffs, this class action underscores a central governance challenge—whether AI tool providers can rely on implied consent in multi-party conversations, or if explicit legal standards will redefine acceptable data practices in enterprise AI. #AIethics#DataProtection#PrivacyLaw#AIGovernance

AI & Law

@ai_and_law · Post #741 · 13.01.2026 г., 08:04

🇭🇰Hong Kong Issues Deepfake Protection Toolkit for Schools Hong Kong’s Office of the Privacy Commissioner for Personal Data (PCPD) has published guidance on the use of an AI deepfake protection toolkit aimed at schools and parents. The guidance explains common types of deepfakes and typical scenarios involving abusive deepfakes in school settings, focusing on risks faced by students. The toolkit provides practical measures for prevention and incident response, outlining the roles of schools, parents, and students. Recommended school-level safeguards include data minimization, restricting access to personal data, and implementing general data security measures to reduce exposure to deepfake misuse. The initiative frames deepfake risks as a data protection and child safety issue, reinforcing the role of privacy governance and preventive controls in educational environments as generative AI tools become more accessible. #AIandLaw#Deepfakes#DataProtection#ChildrenRights#PrivacyLaw#AIRegulation

AI & Law

@ai_and_law · Post #99 · 30.08.2023 г., 07:04

Zoom Addresses EU Privacy Concerns and Updates Terms of Service Greetings! In response to discussions about potential EU privacy law implications, Zoom issues a statement and revises its Terms of Service. The focus? Ensuring customer data isn't utilized to train AI models. Zoom's statement and Terms affirm that user-generated content, including audio, video, chat, and more, isn't employed for training Zoom's or any third-party AI models. This step aims to dispel any concerns. Zoom initially shared its statement on August 7 and later updated it on August 11, aligned with the revised Terms. The shared stance now unequivocally states, "Zoom does not use any of your customer content to train AI models." Earlier, a Stack Diary article flagged changes to Zoom's March Terms, raising potential concerns about broad data utilization for AI model training. Zoom's quick response aims to address these concerns and reaffirm privacy commitments. #Zoom#PrivacyMatters#TermsOfService#AIModels#DataProtection#PrivacyLaw#TechUpdates