Python logo

Table of Contents

  • 3. Data model
    • 3.1. Objects, values and types
    • 3.2. The standard type hierarchy
      • 3.2.1. None
      • 3.2.2. NotImplemented
      • 3.2.3. Ellipsis
      • 3.2.4. numbers.Number
        • 3.2.4.1. numbers.Integral
        • 3.2.4.2. numbers.Real (float)
        • 3.2.4.3. numbers.Complex (complex)
      • 3.2.5. Sequences
        • 3.2.5.1. Immutable sequences
        • 3.2.5.2. Mutable sequences
      • 3.2.6. Set types
      • 3.2.7. Mappings
        • 3.2.7.1. Dictionaries
      • 3.2.8. Callable types
        • 3.2.8.1. User-defined functions
          • 3.2.8.1.1. Special read-only attributes
          • 3.2.8.1.2. Special writable attributes
        • 3.2.8.2. Instance methods
        • 3.2.8.3. Generator functions
        • 3.2.8.4. Coroutine functions
        • 3.2.8.5. Asynchronous generator functions
        • 3.2.8.6. Built-in functions
        • 3.2.8.7. Built-in methods
        • 3.2.8.8. Classes
        • 3.2.8.9. Class Instances
      • 3.2.9. Modules
        • 3.2.9.1. Import-related attributes on module objects
        • 3.2.9.2. Other writable attributes on module objects
        • 3.2.9.3. Module dictionaries
      • 3.2.10. Custom classes
        • 3.2.10.1. Special attributes
        • 3.2.10.2. Special methods
      • 3.2.11. Class instances
        • 3.2.11.1. Special attributes
      • 3.2.12. I/O objects (also known as file objects)
      • 3.2.13. Internal types
        • 3.2.13.1. Code objects
          • 3.2.13.1.1. Special read-only attributes
          • 3.2.13.1.2. Methods on code objects
        • 3.2.13.2. Frame objects
          • 3.2.13.2.1. Special read-only attributes
          • 3.2.13.2.2. Special writable attributes
          • 3.2.13.2.3. Frame object methods
        • 3.2.13.3. Traceback objects
        • 3.2.13.4. Slice objects
        • 3.2.13.5. Static method objects
        • 3.2.13.6. Class method objects
    • 3.3. Special method names
      • 3.3.1. Basic customization
      • 3.3.2. Customizing attribute access
        • 3.3.2.1. Customizing module attribute access
        • 3.3.2.2. Implementing Descriptors
        • 3.3.2.3. Invoking Descriptors
        • 3.3.2.4. __slots__
      • 3.3.3. Customizing class creation
        • 3.3.3.1. Metaclasses
        • 3.3.3.2. Resolving MRO entries
        • 3.3.3.3. Determining the appropriate metaclass
        • 3.3.3.4. Preparing the class namespace
        • 3.3.3.5. Executing the class body
        • 3.3.3.6. Creating the class object
        • 3.3.3.7. Uses for metaclasses
      • 3.3.4. Customizing instance and subclass checks
      • 3.3.5. Emulating generic types
        • 3.3.5.1. The purpose of __class_getitem__
        • 3.3.5.2. __class_getitem__ versus __getitem__
      • 3.3.6. Emulating callable objects
      • 3.3.7. Emulating container types
      • 3.3.8. Emulating numeric types
      • 3.3.9. With Statement Context Managers
      • 3.3.10. Customizing positional arguments in class pattern matching
      • 3.3.11. Emulating buffer types
      • 3.3.12. Annotations
      • 3.3.13. Special method lookup
    • 3.4. Coroutines
      • 3.4.1. Awaitable Objects
      • 3.4.2. Coroutine Objects
      • 3.4.3. Asynchronous Iterators
      • 3.4.4. Asynchronous Context Managers

Previous topic

2. Lexical analysis

Next topic

4. Execution model