N
- __name__ attribute, Applying functions generically, Example: Application to module self-test code (preview), Mixed Usage Modes: __name__ and __main__–Unit Tests with __name__, Example: Modules Are Objects, Example: Modules Are Objects, Using Code Two Ways, Class Interface Techniques, Namespace Links: A Tree Climber, Listing instance attributes with __dict__
-
- about, Listing instance attributes with __dict__
- functions and, Applying functions generically
- inspecting inheritance hierarchies, Namespace Links: A Tree Climber
- metaprogram example, Example: Modules Are Objects
- mixed usage modes, Mixed Usage Modes: __name__ and __main__–Unit Tests with __name__
- modules and, Example: Application to module self-test code (preview), Example: Modules Are Objects, Using Code Two Ways
- preset value, Class Interface Techniques
- name collisions, Modules and namespaces
- name mangling, Pseudoprivate Class Attributes, Using __X pseudoprivate names
- name resolution, Name Resolution: The LEGB Rule–Other Python scopes: Preview
- named tuples, Why Tuples?, More Dictionary Methods, Tuples, Records Revisited: Named Tuples–Records Revisited: Named Tuples
- namespace declarations, The global Statement
- namespace dictionaries, Namespace Dictionaries: __dict__, Namespace Dictionaries: Review–Namespace Dictionaries: Review, Slots and namespace dictionaries–Slots and namespace dictionaries
-
- about, Namespace Dictionaries: Review–Namespace Dictionaries: Review
- __dict__ attribute, Namespace Dictionaries: __dict__
- slots and, Slots and namespace dictionaries–Slots and namespace dictionaries
- namespace package model, Module Packages, Module Lookup Rules Summary, Python 3.3 Namespace Packages, Namespace Package Semantics–Impacts on Regular Packages: Optional __init__.py, Namespace Packages in Action–Namespace Packages in Action, Namespace Package Nesting, Files Still Have Precedence over Directories–Files Still Have Precedence over Directories
-
- about, Module Packages, Module Lookup Rules Summary, Python 3.3 Namespace Packages
- file precedence in, Files Still Have Precedence over Directories–Files Still Have Precedence over Directories
- nesting, Namespace Package Nesting
- semantics, Namespace Package Semantics–Impacts on Regular Packages: Optional __init__.py
- usage examples, Namespace Packages in Action–Namespace Packages in Action
- namespaces, The Grander Module Story: Attributes, Modules and namespaces, Modules and namespaces, Python Scope Basics, Python Scope Basics, How (Not) to Obfuscate Your Python Code, Why Use Modules?, Module Namespaces–Namespace Nesting, Files Generate Namespaces, Files Generate Namespaces, Namespace Nesting, Minimizing from * Damage: _X and __all__, Classes and Instances, Instance Objects Are Concrete Items, The World’s Simplest Python Class, Example, Inheritance, Namespaces: The Conclusion, Simple Names: Global Unless Assigned, Attribute Names: Object Namespaces, The “Zen” of Namespaces: Assignments Classify Names–The “Zen” of Namespaces: Assignments Classify Names, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
-
- about, The Grander Module Story: Attributes, Modules and namespaces, Python Scope Basics, Classes and Instances, Namespaces: The Conclusion
- assigning names, The “Zen” of Namespaces: Assignments Classify Names–The “Zen” of Namespaces: Assignments Classify Names
- attribute names and, Attribute Names: Object Namespaces
- classes and, Example
- __dict__ attribute, How (Not) to Obfuscate Your Python Code, Files Generate Namespaces, The World’s Simplest Python Class
- files generating, Files Generate Namespaces
- inheritance and, Inheritance
- instances and, Instance Objects Are Concrete Items
- LEGB rule and, Simple Names: Global Unless Assigned, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
- minimizing namespace pollution, Minimizing from * Damage: _X and __all__
- modules and, Modules and namespaces, Why Use Modules?, Module Namespaces–Namespace Nesting
- nested classes and, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
- nesting, Namespace Nesting
- scope and, Python Scope Basics
- naming conventions and rules, Variable Name Rules–Names have no type, but objects do, Python Scope Basics, Name Resolution: The LEGB Rule–Other Python scopes: Preview, The Built-in Scope, Minimizing from * Damage: _X and __all__, Name Considerations in Tool Classes, Simple Names: Global Unless Assigned, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
-
- classes, Name Considerations in Tool Classes
- LEGB rule, Name Resolution: The LEGB Rule–Other Python scopes: Preview, The Built-in Scope, Simple Names: Global Unless Assigned, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
- scope and, Python Scope Basics
- for variables, Variable Name Rules–Names have no type, but objects do
- _x name prefix, Minimizing from * Damage: _X and __all__
- __ne__ method, Common Operator Overloading Methods, Comparisons: __lt__, __gt__, and Others
- nesting, Numbers, Nesting, Nesting Revisited, Advanced Formatting Method Syntax, Indexing, Slicing, and Matrixes, Dictionaries, Changing Dictionaries in Place, Nesting in dictionaries, Tuples, Nesting Code Three Levels Deep, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X, Nested for loops–Nested for loops, Filter clauses: if–Nested loops: for, def Executes at Runtime, Scopes and Nested Functions–Arbitrary scope nesting, Loop variables may require defaults, not scopes, Loop variables may require defaults, not scopes, Loop variables may require defaults, not scopes, Scopes: lambdas Can Be Nested Too, Scopes: lambdas Can Be Nested Too, Adding Tests and Nested Loops: filter–Formal comprehension syntax, Namespace Nesting, Namespace Package Nesting, Coding Class Trees, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited, Combining finally and except by Nesting, Nesting Exception Handlers–Example: Syntactic Nesting, Example: Control-Flow Nesting, Example: Syntactic Nesting–Example: Syntactic Nesting, Breaking Out of Multiple Nested Loops: “go to”, Decorator Nesting–Decorator Nesting, Using nested functions to decorate methods, Decorator nesting
-
- blocks of code, Nesting Code Three Levels Deep, Block Delimiters: Indentation Rules–Avoid mixing tabs and spaces: New error checking in 3.X
- classes, Nested Classes: The LEGB Scopes Rule Revisited–Nested Classes: The LEGB Scopes Rule Revisited
- control flows, Example: Control-Flow Nesting
- decorators, Decorator Nesting–Decorator Nesting, Decorator nesting
- def statement, def Executes at Runtime, Loop variables may require defaults, not scopes, Coding Class Trees
- dictionaries, Nesting Revisited, Dictionaries, Changing Dictionaries in Place, Nesting in dictionaries
- exception handlers, Nesting Exception Handlers–Example: Syntactic Nesting
- for statement, Nested for loops–Nested for loops
- functions, Scopes and Nested Functions–Arbitrary scope nesting, Scopes: lambdas Can Be Nested Too, Using nested functions to decorate methods
- lambda expressions, Loop variables may require defaults, not scopes, Scopes: lambdas Can Be Nested Too
- lists, Nesting, Indexing, Slicing, and Matrixes
- loops, Filter clauses: if–Nested loops: for, Loop variables may require defaults, not scopes, Adding Tests and Nested Loops: filter–Formal comprehension syntax, Breaking Out of Multiple Nested Loops: “go to”
- mathematical operations, Numbers
- namespace packages, Namespace Package Nesting
- namespaces, Namespace Nesting
- string formatting, Advanced Formatting Method Syntax
- try/except/finally statement, Combining finally and except by Nesting, Example: Syntactic Nesting–Example: Syntactic Nesting
- tuples, Tuples
- NetBeans IDE, Other IDEs
- __new__ method, Common Operator Overloading Methods, Object Destruction: __del__, A Basic Metaclass
- new-style classes, Other Ways to Combine Classes, Multiple Inheritance: “Mix-in” Classes, Multiple Inheritance: “Mix-in” Classes, Room for improvement: MRO, slots, GUIs, The “New Style” Class Model–Just How New Is New-Style?, New-Style Class Changes–Example: Mapping Attributes to Inheritance Sources, New-Style Class Changes, Example: Mapping Attributes to Inheritance Sources–Example: Mapping Attributes to Inheritance Sources, Example: Mapping Attributes to Inheritance Sources, New-Style Class Extensions–Other Class Changes and Extensions, Slots: Attribute Declarations–What about slots speed?, Properties: Attribute Accessors–Property basics, __getattribute__ and Descriptors: Attribute Tools, Other Class Changes and Extensions
-
- about, Other Ways to Combine Classes, The “New Style” Class Model–Just How New Is New-Style?
- attribute tools, __getattribute__ and Descriptors: Attribute Tools
- changes in, New-Style Class Changes–Example: Mapping Attributes to Inheritance Sources, Other Class Changes and Extensions
- class tools, New-Style Class Changes, Example: Mapping Attributes to Inheritance Sources–Example: Mapping Attributes to Inheritance Sources
- extensions to, New-Style Class Extensions–Other Class Changes and Extensions
- MRO and, Multiple Inheritance: “Mix-in” Classes, Room for improvement: MRO, slots, GUIs
- multiple inheritance in, Multiple Inheritance: “Mix-in” Classes
- properties, Properties: Attribute Accessors–Property basics
- slots, Example: Mapping Attributes to Inheritance Sources, Slots: Attribute Declarations–What about slots speed?
- next built-in function, Iteration and Optimization, Manual Iteration: iter and next–Manual iteration, Preview: User-defined iterables in classes
- __next__ method, The Iteration Protocol: File Iterators, Manual Iteration: iter and next, Iteration protocol integration, Preview: User-defined iterables in classes, Common Operator Overloading Methods, Iterable Objects: __iter__ and __next__–Multiple iterators with yield
-
- about, Manual Iteration: iter and next, Common Operator Overloading Methods
- file iterators and, The Iteration Protocol: File Iterators
- generator functions and, Iteration protocol integration
- iterable objects and, Iterable Objects: __iter__ and __next__–Multiple iterators with yield
- user defined iterables and, Preview: User-defined iterables in classes
- None object, Other Core Types, The None object
- nonlocal statement, Python’s Statements, Coding Functions, Scope Details, The global Statement, The nonlocal Statement in 3.X–Boundary cases, The nonlocal Statement in 3.X–Boundary cases, Boundary cases, Why nonlocal? State Retention Options–State with mutables: Obscure ghost of Pythons past?, Function Interfaces and Callback-Based Code, Enclosing scopes and globals–Enclosing scopes and nonlocals, Coding alternatives
-
- about, Python’s Statements, Scope Details, The global Statement, The nonlocal Statement in 3.X–Boundary cases
- boundary cases, Boundary cases
- coding functions, Coding Functions
- enclosing scope and, Function Interfaces and Callback-Based Code, Enclosing scopes and globals–Enclosing scopes and nonlocals, Coding alternatives
- state retention options, Why nonlocal? State Retention Options–State with mutables: Obscure ghost of Pythons past?
- version considerations, The nonlocal Statement in 3.X–Boundary cases
- normal versus chained comparisons, Comparisons: Normal and Chained–Comparisons: Normal and Chained
- NotImplemented object, Propagating class type
- NotImplementedError exception, Abstract Superclasses
- numbers, Python’s Core Data Types, Numbers–Numbers, Numbers, Numbers, Numbers, Numbers, Other Core Types, Other Core Types, Other Core Types, Other Core Types, Other Core Types, Numeric Type Basics, Numeric Literals–Numeric Literals, Built-in Numeric Tools, Python Expression Operators–Preview: Operator overloading and polymorphism, Variables and Basic Expressions–Variables and Basic Expressions, Variables and Basic Expressions–Variables and Basic Expressions, Numeric Display Formats, Comparisons: Normal and Chained–Comparisons: Normal and Chained, Division: Classic, Floor, and True–Why does truncation matter?, Complex Numbers, Bitwise Operations–Bitwise Operations, Other Built-in Numeric Tools–Other Built-in Numeric Tools, Sets, Numeric Extensions, Test Your Knowledge: Quiz, Comparisons, Equality, and Truth
-
- about, Numbers–Numbers, Numeric Type Basics
- bitwise operations, Bitwise Operations–Bitwise Operations
- Booleans, Other Core Types (see Booleans)
- built-in tools, Built-in Numeric Tools, Other Built-in Numeric Tools–Other Built-in Numeric Tools
- comparison operations, Comparisons: Normal and Chained–Comparisons: Normal and Chained, Comparisons, Equality, and Truth
- complex, Numbers, Complex Numbers
- decimals, Other Core Types (see decimals)
- division operation, Division: Classic, Floor, and True–Why does truncation matter?
- expression operators, Python Expression Operators–Preview: Operator overloading and polymorphism
- in expressions, Variables and Basic Expressions–Variables and Basic Expressions
- floating-point, Other Core Types (see floating-point numbers)
- fractions, Other Core Types (see fractions)
- integers, Numbers (see integers)
- numeric display formats, Numeric Display Formats
- numeric extensions, Numeric Extensions
- numeric literals, Python’s Core Data Types, Numeric Literals–Numeric Literals
- quiz questions and answers, Test Your Knowledge: Quiz
- rational, Numbers, Other Core Types
- sequence operations, Numbers
- sets, Sets (see sets)
- in variables, Variables and Basic Expressions–Variables and Basic Expressions
- numeric programming, Numeric and Scientific Programming
- NumPy numeric programming extension, Why Do People Use Python?, OK, but What’s the Downside?, Numeric and Scientific Programming, Nesting, Numeric Extensions
-
- about, Why Do People Use Python?, OK, but What’s the Downside?, Numeric and Scientific Programming
- customer base, Numeric Extensions
- matrix support, Nesting