TGViewer
PyNotes PyNotes @py_notes_uz · 207 subscribers
Post #99 468
PyNotes Title: Namespaces A namespace is a system that has a unique name for each and every object in Python. An object might be a variable or a method. There are 3 types of namespaces: built-in namespaces global namespaces local namespaces e.g var1 = 5 # global…
Namespaces have different lifetimes, because they are often created at different points in time.

📌 The namespace containing the built-in names is created when the Python interpreter starts up, and is never deleted.

📌 The global namespace of a module is generated when the module is read in. Module namespaces normally last until the script ends, i.e. the interpreter quits.
📌 When a function is called, a local namespace is created for this function. This namespace is deleted either if the function ends, i.e. returns, or if the function raises an exception, which is not dealt with within the function.

source
python-course.eu 27. Namespaces | Python Tutorial | python-course.eu Introduction into Namespaces and Scopes in Python
More from @py_notes_uz
  1. Sep 10, 2026👋 Accepted AI Men sizga orzuingizdagi ishga qabul qilinishda yordam beraman: 📊 CV'ingizn…
  2. May 5, 2026Middle/Senior Full Stack (Python+TypeScript) | Sigma Software Qualifications • 6+ years of…
  3. Apr 16, 2026🇺🇿 o'zbek tilida 🇷🇺 на русском AI Incubator 2026 — Applications Open 🚀 Launch your AI…
  4. Mar 24, 2026Want to learn how AI agents are built at Yandex? The Yandex School of Data Analysis is run…
  5. Feb 17, 2026💡 Python bo'yicha ko'nikmalaringizni sanoat standartlari darajasiga oshirishni va mutaxas…
  6. Jan 22, 2026Why default argument [] dangerous in Python? e.g def add_item(item, items=[]) In Python, d…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →