You can type a list as of Python 3.5

https://docs.python.org/3/library/typing.html

from typing import List

vector: List[float] = list()

or

from typing import List

vector: List[float] = []

Python is dynamically typed however https://www.python.org/dev/peps/pep-0484/

Typing makes it easier to read code, easier understand it, make efficient use of your IDE tooling and create higher quality software. I guess that's why it's in the PEP.

Answer from Shaun Ryan on Stack Overflow
🌐
W3Schools
w3schools.com › python › python_lists.asp
Python Lists
Lists are used to store multiple items in a single variable. Lists are one of 4 built-in data types in Python used to store collections of data, the other 3 are Tuple, Set, and Dictionary, all with different qualities and usage.
Discussions

Type Hints, can you indicate various types inside a list?
You could use List[Union[str, int]] for a list that contains strings and ints, but that is not what you have here. This is actually a list of tuples, each of which has a str and an int. For that you can use List[Tuple[str, int]] which specifically says that each tuple contains two items, the first of which is a string and the second an int. Also note that on Python 3.9+ you should use the built-in types rather than the ones defined in typing, so list[tuple[str, int]]. And note again that in your example list_of_grades[0] isn't a string, it's a tuple of (string, int). More on reddit.com
🌐 r/learnpython
7
2
November 15, 2021
Checking the type of a list
It’s because you’re comparing the type of the meta[0] element with the object ‘list’. Try renaming 'list' to 'mylist': mylist = [4,6,3] meta = [mylist] print(type(meta[0]) == list) More on reddit.com
🌐 r/learnpython
7
1
February 7, 2024
🌐
Real Python
realpython.com › python-list
Python's list Data Type: A Deep Dive With Examples – Real Python
June 26, 2026 - List literals are probably the most popular way to create a list object in Python. These literals are fairly straightforward. They consist of a pair of square brackets enclosing a comma-separated series of objects. ... This syntax creates a list of n items by listing the items in an enclosing pair of square brackets. Note that you don’t have to declare the items’ type or the list’s size beforehand.
🌐
Python documentation
docs.python.org › 3 › library › typing.html
typing — Support for type hints
For most containers in Python, the typing system assumes that all elements in the container will be of the same type. For example: from collections.abc import Mapping # Type checker will infer that all elements in ``x`` are meant to be ints x: list[int] = [] # Type checker error: ``list`` only accepts a single type argument: y: list[int, str] = [1, 'foo'] # Type checker will infer that all keys in ``z`` are meant to be strings, # and that all values in ``z`` are meant to be either strings or ints z: Mapping[str, str | int] = {}
🌐
Real Python
realpython.com › ref › builtin-types › list
list | Python’s Built-in Data Types – Real Python
The built-in list data type is a versatile and widely-used data structure in Python that allows for the storage and manipulation of ordered, mutable sequences of elements.
🌐
Google
developers.google.com › google for education › python › python lists
Python Lists | Python Education | Google for Developers
Python's built-in list type is defined using square brackets [ ] and elements are accessed using zero-based indexing.
🌐
InfoWorld
infoworld.com › home › software development › programming languages › python
How to work with the Python list data type | InfoWorld
September 6, 2023 - Use Python lists to store data in one-dimensional rows, access them by indexes, and sort them any which way you like.
Find elsewhere
🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.8 documentation
2 days ago - We saw that lists and strings have many common properties, such as indexing and slicing operations. They are two examples of sequence data types (see Sequence Types — list, tuple, range). Since Python is an evolving language, other sequence data types may be added.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-lists
Python Lists - GeeksforGeeks
Data Types · Interview Questions · Examples · Quizzes · DSA Python · Data Science · NumPy · Pandas · Practice · Django · Flask · Last Updated : 19 Sep, 2026 · List is a built-in data structure used to store an ordered collection of items.
Published: 2 weeks ago
🌐
Wamaithanyamu
wamaithanyamu.com › python-lists
Using Lists in python with type hints
December 31, 2022 - # Import the type hint module # Any means the List will take in any type of data type from typing import List, Any # Initialised using square brackets my_empty_list: List[Any] = [] print(my_empty_list) my_list_of_integers: List[int] = [1,2,3,4] print(my_list_of_integers) my_list_of_floats: List[float] = [1.2, 3.4, 5.6] print(my_list_of_floats) my_list_of_strings: List[str] =["this", "is" ,"a" ,"string"] print(my_list_of_strings) my_list_of_booleans: List[bool] =[True,False,False,True] print(my_list_of_booleans) my_mixed_list: List[Any] = [1, "Hello", False, 1.23] print(my_mixed_list)
🌐
Medium
medium.com › @datasciencejourney100_83560 › all-about-list-data-type-in-python-for-data-science-6070ecde2a36
All You Need to Know about List Data Type in Python for Data Science | by Rina Mondal | Medium
September 3, 2025 - Lists are versatile and can contain elements of different data types, including numbers, strings, and other lists. Lists are defined by enclosing elements in square brackets ([]) and separating them with commas. In this blog, I will describe everything about list in Python:
🌐
LabEx
labex.io › tutorials › python-how-to-check-list-type-in-python-419404
How to check list type in Python | LabEx
Python lists can contain elements of different types, making them extremely flexible for various programming scenarios.
🌐
Reddit
reddit.com › r/learnpython › type hints, can you indicate various types inside a list?
r/learnpython on Reddit: Type Hints, can you indicate various types inside a list?
November 15, 2021 -

If I have a list that I know will have a certain type of object in the first element and a different type in the second. For instance, if I have a function that combines two lists and returns a lists of lists like so:

names = ["Brad Pitt", "Leonardo DiCaprio", "Henry Cavill", "Hugo Weaving"]
grades = [85,32,95,90]

def combine_lists():
    names_grades = []
    for i in range(0,4):
        names_grades.append(names[i],grades[i])
    return names_grades

Is it possible to type hint the return type so that it reflects the types in the list, something like this:

def combine_lists() ->List(str,int):

The point of this is that later I would be aware of the type I'm accessing when I try to read a specific element of the list for example:

list_of_grades = combine_lists()x = list_of_grades[0] #I want to know this is a string

🌐
Tutorialspoint
tutorialspoint.com › python › python_lists.htm
Python - Lists
List is one of the built-in data types in Python. A Python list is a sequence of comma separated items, enclosed in square brackets [ ]. The items in a Python list need not be of the same data type.
🌐
FastAPI
fastapi.tiangolo.com › python-types
Python Types Intro - FastAPI
As the list is a type that contains some internal types, you put them in square brackets: Python 3.10+ def process_items(items: list[str]): for item in items: print(item) Note · Those internal types in the square brackets are called "type parameters". In this case, str is the type parameter passed to list.
🌐
Untitled Publication
sahilsss.hashnode.dev › types-of-lists-in-python-overview
Types of Lists in Python Overview - Sahil Saini's Blog
September 30, 2023 - Lists are created by placing a comma-separated sequence of items within square brackets []. Each item in a list can be of any data type, including integers, strings, floats, and even other lists.