object
A piece of data in memory together with the operations, called methods, that belong to it; in Python every value is an object.
In more detail
Every Python object has an identity, a type and a value, and its type decides which methods it has. Variables are names that refer to objects, and containers such as lists store references to objects rather than the objects themselves. The id() function shows an object's identity, and you make your own kinds of object by writing a class.
Related terms
- class — A blueprint in code that bundles data and the functions that work on it, from which objects are made.
- pointer — A value that stores the memory location of another piece of data, so the program can follow it to that data.
- Python list — Python's built-in ordered, growable sequence, implemented as a dynamic array of pointers to objects.
- method — A function that belongs to an object or type and is called on a value of it, as in name.upper().
- dot notation — Writing object.name to reach a method or attribute that belongs to an object or module, as in s.upper() or math.pi.
- data type — The kind of a value, such as a whole number, text or a date, which decides what you can do with it and how it compares and sorts.
Taught in
- Space, In-Place Work And The Call Stack — Algorithms & Data Structures for Working Engineers
- Amortised Analysis: Why Append Is Cheap — Algorithms & Data Structures for Working Engineers
- Python Dicts And Sets Under The Hood — Algorithms & Data Structures for Working Engineers
- Collisions In Practice And Hash Flooding — Algorithms & Data Structures for Working Engineers
- Arrays: Contiguous Memory And Constant-Time Access — Algorithms & Data Structures for Working Engineers
- Representing A Graph: Matrix Or Adjacency List — Algorithms & Data Structures for Working Engineers
- Types And Functions, A Whirlwind Tour — Hands-on Python: Complete Video Course & Book
- Literals, Identifiers And Keywords — Hands-on Python: Complete Video Course & Book
- The String Format Method — Hands-on Python: Complete Video Course & Book
- Objects, Methods And String Case — Hands-on Python: Complete Video Course & Book
- Reading The graphics.py Documentation — Hands-on Python: Complete Video Course & Book
- Mutable Objects And Aliases — Hands-on Python: Complete Video Course & Book
- The Exception Family Tree — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Tuples, And The Comma That Makes Them — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Collections Sprint — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Functions, Return Values And Recursion — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Parameters, Arguments And Scope — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Try, Except, Else And Finally — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- Mock, Review And Exam Day — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep
- The Class That Shared One List — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Sixty Five Minutes, Forty Items: How PCAP Is Run — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Modules Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Handlers, args, raise And assert — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Exception Classes Of Your Own — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Exceptions Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Characters As Numbers — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Strings Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Classes, Objects And Two Stacks — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Class Variables, Instance Variables And __dict__ — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Methods And The self Parameter — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Introspection: hasattr, __name__, __module__ And __bases__ — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Inheritance, super() And Polymorphism — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Multiple Inheritance, The MRO And Diamonds — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Special Methods: __str__, __eq__ And Friends — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Object-Oriented Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- List Comprehensions, Filtered And Nested — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Lambdas, map() And filter() — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Generators And Iterators — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Streams, Handles And Open Modes — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- read, readline, errno And bytearray — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Comprehensions, Closures And Files Sprint — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Twelve Traps, Mostly Objects — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep
- Mock, Review And Exam Day — PCAP Certified Associate in Python Programming (PCAP-31-03) Exam Prep