Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

14.2. Code Objects

Callables are a crucial part of the Python execution environment, yet are only one element of a larger landscape. The grander picture consists of Python statements, assignments, expressions, even modules. These other “executable objects” do not have the ability to be invoked like callables. Rather, these objects are the smaller pieces of the puzzle which make up executable blocks of code called code objects.

At the heart of every callable is a code object which consists of statements, assignments, expressions, and other callables. Looking at a module means viewing one large code object which contains all the code found in the module, which can then be dissected into statements, assignments, expressions, and callables which recurse to another layer as they contain their own code objects.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint