๐ŸŒ
Swarthmore College
cs.swarthmore.edu โ€บ courses โ€บ CS21Book โ€บ ch13.html
13. Classes and objects โ€” How to Think Like a Computer Scientist: Learning with Python 2nd Edition documentation
The question, then, is how to group these two values into a compound object. The quick and dirty solution is to use a list or tuple, and for some applications that might be the best choice. An alternative is to define a new user-defined compound type, also called a class.
๐ŸŒ
Medium
spathis.medium.com โ€บ understanding-python-compound-data-types-a-comprehensive-guide-1287bf68601f
Understanding Python Compound Data Types: A Comprehensive Guide | by Promethee Spathis | Medium
July 23, 2024 - 2. Order: The order in which the elements are specified when the object is defined is maintained for the objectโ€™s lifetime unless explicitly changed. Ordered: Lists, tuples, strings, bytes, bytearrays. Unordered: Sets, dictionaries (though dictionaries maintain insertion order since Python 3.7). 3. Uniqueness: Some compound data types allow for duplicate elements to be added.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ reference โ€บ compound_stmts.html
8. Compound statements โ€” Python 3.15.0 documentation
5 days ago - For the following built-in types the handling of positional subpatterns is different: ... These classes accept a single positional argument, and the pattern there is matched against the whole object rather than an attribute. For example int(0|1) matches the value 0, but not the value 0.0. In simple terms CLS(P1, attr=P2) matches only if the following happens: ... A function definition defines a user-defined function object (see section The standard type hierarchy):
๐ŸŒ
Fahadsultan
fahadsultan.com โ€บ csc122 โ€บ data โ€บ oop1.html
6.2. User-defined Types โ€” Data Structures and Algorithms
The question, then, is how to group these two values into a compound object. The quick and dirty solution is to use a list or tuple, and for some applications that might be the best choice. An alternative is to define a new user-defined compound type, also called a class.
๐ŸŒ
Thewiz
thewiz.net โ€บ python_compound_datatypes_81d.html
Python (3/7) Compound Datatypes
The code below describes the definition of a list and how its elements can be accessed. Note that unlike many other languages, Python does not insist on having a consistent data type among the elements of the list. We can have a number, string, boolean and any other data types in the same list.
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ what-are-compound-data-types-and-data-structures-in-python
What are compound data types and data structures in Python?
August 23, 2023 - A Tuple is an immutable sequence data type that can contain elements of various data types. A tuple is just a collection of Python objects separated by commas.
๐ŸŒ
Educative
educative.io โ€บ home โ€บ compound data types
Compound Data Types
Explore compound data types in Python: list, tuple, set, dict. Understand how compound data types provide ways to organize data values of any data type.
๐ŸŒ
Payilagam
payilagam.com โ€บ blogs โ€บ compound-data-types-in-python
Compound Data Types in Python Explained: List, Tuple ,set
October 10, 2025 - Learn Python compound data typesโ€”Lists, Tuples, Sets, and Dictionariesโ€”through real-world examples. Understand key differences, use cases, and interview questions.
๐ŸŒ
LinkedIn
linkedin.com โ€บ pulse โ€บ compound-data-type-python-er-suraj-kumar-soni
Compound Data Type In Python
January 22, 2023 - In Python, a compound data type is a type of data that is made up of multiple values or data types. The two most commonly used compound data types in Python are lists and tuples.
Find elsewhere
๐ŸŒ
Rosetta Code
rosettacode.org โ€บ wiki โ€บ Compound_data_type
Compound data type - Rosetta Code
4 weeks ago - The sequence is a natural compound data type. The following would be the same without the type point and declaring p as a sequence, apart from the run-time error. There would be no difficulty defining point to have a string and two atoms.
๐ŸŒ
Greenteapress
greenteapress.com โ€บ thinkpython โ€บ thinkCSpy โ€บ html โ€บ chap12.html
Chapter 12: Classes and objects
Having used some of Python's built-in types, we are ready to create a user-defined type: the Point ยท Consider the concept of a mathematical point. In two dimensions, a point is two numbers (coordinates) that are treated collectively as a single object. In mathematical notation, points are ...
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 75890891 โ€บ how-to-make-a-compound-generic-type
python - How to make a compound generic type - Stack Overflow
I'd like to make a generic compound type that will set different type hints (but related to each other) for different attributes of the class. I got this: from typing import Generic, Literal, NewTy...
๐ŸŒ
RC Learning Portal
learning.rc.virginia.edu โ€บ courses โ€บ python-introduction โ€บ compound_types
Compound Types | RC Learning Portal
If x is a floating-point number, it takes on one value at a time. Compound types are those for which a single variable represents many elements. In Python, compound types can be sequences, which can be ordered by integer indexes.
๐ŸŒ
CSVeda
csveda.com โ€บ home โ€บ python list- a compound data type
Python list- A Compound Data Type - CSVeda
February 28, 2020 - Python list is a powerful compound data type that can be used to store elements of variable types unlike array which only allows elements of same data type
๐ŸŒ
GitHub
jdblischak.github.io โ€บ 2013-09-19-chicago โ€บ lessons โ€บ thw-python โ€บ data-structures โ€บ tutorial.html
Data Types in Python
Tuples are another of python's basic compound data types that are almost like lists. The difference is that a tuple is immutable; once you set the data in it, the tuple cannot be changed. You define a tuple as follows.
๐ŸŒ
Molssi
education.molssi.org โ€บ type-hints-pydantic-tutorial โ€บ chapters โ€บ TypeHintsInPython.html
Type Hints in Python โ€” Python Type Hints, Dataclasses, and Pydantic
There is an important point to make about the difference between list and tuple as type hint. list are considered mutable objects in Python, so in our example the list[str] hint indicates the โ€œlist is of arbitrary length and every object is a string.โ€ Because of this, list only accepts one argument to its [], and adding more will throw an error. ... How would you specify multiple valid types for a list using compound types and what we've already covered?
๐ŸŒ
O'Reilly
oreilly.com โ€บ library โ€บ view โ€บ python-for-absolute โ€บ 9781806385119 โ€บ index_split_013.html
COMPOUND DATA TYPES - Python for Absolute Beginners [Book]
August 19, 2025 - The most common compound data type is a list, which is an ordered collection of values (also called โ€œelementsโ€). These values can be any type, including integers, floating-point numbers, strings, Booleans, or even other lists to form a nested list. This means that a list can contain any Python data type and the list itself is a Python data type too.
Author: Oliver Theobald
Published: 2025
Pages: 122
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ python_datatypes.asp
Python Data Types
In programming, data type is an important concept. Variables can store data of different types, and different types can do different things. Python has the following data types built-in by default, in these categories:
๐ŸŒ
GitConnected
levelup.gitconnected.com โ€บ learn-programming-with-python-introduction-to-compound-data-types-lists-57b50e2633c6
Learn Programming with Python โ€” Introduction to Compound Data Types: Lists | by Richard Quinn | Level Up Coding
May 11, 2020 - Weโ€™re finally getting to the heart of what makes Python magical! Lists are an enormously powerful tool for creating beautiful software. Lists are exactly what we might be expecting: the list compound data type contains an ordered list of objects. The list โ€” unlike the set โ€” may contain duplicates and is in a specific order.
๐ŸŒ
Python documentation
docs.python.org โ€บ 3 โ€บ library โ€บ typing.html
typing โ€” Support for type hints
June 23, 2023 - Concatenate can be used in conjunction with Callable and ParamSpec to annotate a higher-order callable which adds, removes, or transforms parameters of another callable. Usage is in the form Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]. Concatenate is valid when used in Callable type hints and when instantiating user-defined generic classes with ParamSpec parameters.