Published: Apress, 2014
Description:
1 online resource.
Contents:
“…Using __all __ to Customize Imports -- Relative Imports -- The __import__() function -- The importlib module -- Taking It With You -- Chapter 3: Functions -- Arguments --
Planning for Flexibility -- Variable Positional Arguments -- Variable Keyword Arguments -- Combining Different Kinds of Arguments -- Invoking Functions with Variable Arguments -- Preloading Arguments -- Introspection -- Example: Identifying Argument Values -- Example: A More Concise Version -- Example: Validating Arguments -- Decorators -- Closures -- Wrappers -- Decorators with Arguments -- Decorators with-or without-Arguments -- Example: Memoization -- Example: A Decorator to Create Decorators -- Function Annotations -- Example: Type Safety -- Factoring Out the Boilerplate -- Example: Type Coercion -- Annotating with Decorators -- Example: Type Safety as a Decorator -- Generators -- Lambdas -- Introspection -- Identifying Object Types -- Modules and Packages -- Docstrings -- Taking It with You -- Chapter 4: Classes -- Inheritance -- Multiple Inheritance -- Method Resolution Order -- Example: C3 Algorithm -- Using super() to Pass Control to Other Classes -- Introspection -- How Classes Are Created -- Creating Classes at Runtime -- Metaclasses -- Example: Plugin Framework -- Controlling the Namespace -- Attributes -- Properties -- Descriptors -- Methods -- Unbound Methods -- Bound Methods -- Class Methods -- Static Methods -- Assigning Functions to Classes and Instances -- Magic Methods -- Creating Instances -- Example: Automatic Subclasses -- Dealing with Attributes -- String Representations -- Taking It With You -- Chapter 5: Common Protocols -- Basic
Operations -- Mathematical
Operations -- Bitwise
Operations -- Variations -- Numbers -- Sign
Operations -- Comparison
Operations -- Iterables -- Example: Repeatable Generators -- Sequences -- Mappings -- Callables.…”
Call Number:
Loading…
Located:
Loading…
SpringerLink - Click here for access
eBook