Перейти к содержимому

Python Scope - What Is NameError and UnboundLocalError? - How Python Finds Names

KP Data Dev

0:00 / 0:00

Python Scope - What Is NameError and UnboundLocalError? - How Python Finds Names

227 просмотров · 1 г. назад
KP Data Dev
198 подписчиков
227 просмотров · 1 г. назад
Life's good until you hit that NameError or UnboundLocalError. Avoid unnecessary pain by mastering Python scope. We'll explore the 4-step process Python uses to find your variables, functions, and classes. We'll also take a peek into closures and the bytecode dissembler. 👉 Sign up for the newsletter: https://kpdata.dev/newsletter/ Chapters: 00:00 Introduction 00:43 Scope Basics: Local and Global 02:52 LEGB Rule 03:47 Built-In Scope 05:50 Enclosing Scope 07:37 Closures 11:13 Modifying Scope Rules 18:33 Outro Blog post: https://kpdata.dev/blog/python-scope/ #python #scope #software #design