Skip to Content
Python: Essential Reference, Third Edition
book

Python: Essential Reference, Third Edition

by David Beazley
February 2006
Intermediate to advanced content levelIntermediate to advanced
648 pages
14h 53m
English
Sams
Content preview from Python: Essential Reference, Third Edition

new

The new module is used to create various types of objects used by the interpreter. The primary use of this module is by applications that need to create objects in a nonstandard manner (such as when unmarshalling data).

instance(class, dict)

Creates an old-style class instance of class with dictionary dict without calling the __init__() method. Does not work with classes that inherit from object (new-style classes).

instancemethod(function, instance, class)

Creates a method object, bound to instance.function must be a callable object. If instance is None, an unbound instance method is created.

function(code, globals [, name [, argdefs]])

Creates a function object with the given code object and global namespace. name is the name of the function ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python: Essential Reference

Python: Essential Reference

David M. Beazley

Publisher Resources

ISBN: 0672328623Purchase book