def __init__ ( self , scope , parent ) : CodeStatement . __init__ ( self , scope , parent ) self . body = CodeBlock ( scope , self , explicit = True ) self . catches = [ ] self . finally_body = CodeBlock ( scope , self , explicit = True )
python try block create a scope
Constructor for try block structures .
def __init__(self, scope, parent):
        """Constructor for try block structures.

        Args:
            scope (CodeEntity): The program scope where this object belongs.
            parent (CodeEntity): This object's parent in the program tree.
        """
        CodeStatement.__init__(self, scope, parent)
        self.body = CodeBlock(scope, self, explicit=True)
        self.catches = []
        self.finally_body = CodeBlock(scope, self, explicit=True)