Python Language Code blocks, execution frames, and namespaces Code block namespaces

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Code Block TypeGlobal NamespaceLocal Namespace
Modulen.s. for the modulesame as global
Script (file or command)n.s. for __main__same as global
Interactive commandn.s. for __main__same as global
Class definitionglobal n.s. of containing blocknew namespace
Function bodyglobal n.s. of containing blocknew namespace
String passed to exec statementglobal n.s. of containing blocklocal namespace of containing block
String passed to eval()global n.s. of callerlocal n.s. of caller
File read by execfile()global n.s. of callerlocal n.s. of caller
Expression read by input()global n.s. of callerlocal n.s. of caller


Got any Python Language Question?