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 ...

Get Python: Essential Reference, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.