Using type as a keyword argument to a function will mask the built-in function "type" within the scope of the function. So while doing so does not raise a SyntaxError, it is not considered good practice, and I would avoid doing so.

Answer from Brian Gesiak on Stack Overflow
🌐
Python documentation
docs.python.org › 3 › library › typing.html
typing — Support for type hints
The argument list must be a list of types, a ParamSpec, Concatenate, or an ellipsis (...). The return type must be a single type. If a literal ellipsis ... is given as the argument list, it indicates that a callable with any arbitrary parameter list would be acceptable: def concat(x: str, y: str) -> str: return x + y x: Callable[..., str] x = str # OK x = concat # Also OK · Callable cannot express complex signatures such as functions that take a variadic number of arguments, overloaded functions, or functions that have keyword-only parameters.
🌐
W3Schools
w3schools.com › python › python_ref_keywords.asp
Python Keywords
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... Python has a set of keywords that ...
People also ask

What are Python keywords
divPython keywords are specific reserved words whose meanings are predefined in the language and they can not be used as identifiers like variable names or function namesdiv
🌐
scholarhat.com
scholarhat.com › home
List of Python Keywords (With Examples)
What are 36 keywords in Python
divKeywords in Python include False True None and as assert async await def del elif else break class continue except finally for from global if import in is lambda nonlocal not or pass raise return try while with and yielddiv
🌐
scholarhat.com
scholarhat.com › home
List of Python Keywords (With Examples)
Are there 33 or 35 keywords in Python
divThere are a total of 35 keywords in Python as of Python 311 Keywords change with versions as new ones might be introduced and existing ones might get removeddiv
🌐
scholarhat.com
scholarhat.com › home
List of Python Keywords (With Examples)
🌐
Python
peps.python.org › pep-0695
PEP 695 – Type Parameter Syntax | peps.python.org
# A type alias that includes a forward reference type AnimalOrVegetable = Animal | "Vegetable" # A generic self-referential type alias type RecursiveList[T] = T | list[RecursiveList[T]] The type keyword is a new soft keyword. It is interpreted as a keyword only in this part of the grammar.
🌐
Real Python
realpython.com › ref › keywords › type
type | Python Keywords – Real Python
In Python, the type soft keyword allows you to explicitly define generic type aliases in the context of type hints or type annotations. Here’s a quick example demonstrating how to use the type keyword to define a type alias for either a list or set:
🌐
Programiz
programiz.com › python-programming › keyword-list
List of Keywords in Python Programming
In Python we can use it with any type of sequences like a list or a string. Here is an example in which for is used to traverse through a list of names: names = ['John','Monica','Steven','Robin'] for i in names: print('Hello '+i) ... Learn more about Python for loop. import keyword is used to ...
🌐
ScholarHat
scholarhat.com › home
List of Python Keywords (With Examples)
September 10, 2025 - The variable handling keywords are used for manipulating and scoping variables in Python. ... nonlocal-It is used for declaring a variable with a scope of the nearest function just outside the current one. x = 10 print(x) del x print(x) # Raises NameError because x is deleted ... Through this article, we introduced different types of keywords used in Python with their usage and proper examples.
Find elsewhere
🌐
Real Python
realpython.com › python-keywords
Python Keywords: An Introduction – Real Python
February 12, 2025 - You won’t get a SyntaxError if ... or type, but it still isn’t a good idea. For a more in-depth explanation of ways keywords can be misused, check out Invalid Syntax in Python: Common Reasons for SyntaxError. There are thirty-five keywords in Python. Here’s a list of them, each ...
🌐
Mypy
mypy.readthedocs.io › en › stable › cheat_sheet_py3.html
Type hints cheat sheet - mypy 1.19.1 documentation
This document is a quick cheat sheet showing how to use type annotations for various common types in Python.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-type-function
type() function in Python - GeeksforGeeks
Example 1: Checks the data types of different Python values to show how type() identifies built-in data types.
Published   April 16, 2018
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-keywords
Python Keywords - GeeksforGeeks
December 3, 2025 - They define the rules and structure of Python programs which means you cannot use them as names for your variables, functions, classes or any other identifiers. We can also get all the keyword names using the below code. ... The list of keywords are: ['False', 'None', 'True', 'and', 'as', 'assert', 'async', 'await', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
🌐
W3Schools
w3schools.com › python › ref_func_type.asp
Python type() Function
Python Overview Python Built-in Functions Python String Methods Python List Methods Python Dictionary Methods Python Tuple Methods Python Set Methods Python File Methods Python Keywords Python Exceptions Python Glossary · Built-in Modules Random Module Requests Module Statistics Module Math Module cMath Module · Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training · ❮ Built-in Functions · Return the type of these objects: a = ('apple', 'banana', 'cherry') b = "Hello World" c = 33 x = type(a) y = type(b) z = type(c) Try it Yourself » ·
🌐
HubSpot
blog.hubspot.com › home › the hubspot website blog
All of the Python Keywords You Need to Know
HubSpot’s Website Blog covers everything you need to know to build maintain your company’s website.
🌐
WsCube Tech
wscubetech.com › resources › python › keywords
Keywords in Python: All Lists With Examples
October 1, 2025 - Explore all Python keywords in our comprehensive list with examples. Learn how to use each keyword effectively in your Python programming.
🌐
FastAPI
fastapi.tiangolo.com › python-types
Python Types Intro - FastAPI
Then you can declare a variable to be of type Person: ... class Person: def __init__(self, name: str): self.name = name def get_person_name(one_person: Person): return one_person.name ... Notice that this means "one_person is an instance of the class Person". It doesn't mean "one_person is the class called Person". Pydantic is a Python library to perform data validation.
🌐
Python
docs.python.org › 3 › library › keyword.html
keyword — Testing for Python keywords
Source code: Lib/keyword.py This module allows a Python program to determine if a string is a keyword or soft keyword.
🌐
Shiksha
shiksha.com › home › it & software › it & software articles › programming articles › keywords in python
Keywords in Python - Shiksha Online
March 19, 2023 - 1. Value Keyword 2. Operator Keyword 3. Iteration Keyword 4. Conditional Keyword 5. Structure Keyword 6. Returning Keyword 7. Import Keyword 8. Exceptional Handling Keyword 9. Asynchronous Keyword 10.
🌐
Python.org
discuss.python.org › ideas
Use type keyword for defining NewTypes in Non-Generic types - Ideas - Discussions on Python.org
February 7, 2024 - Now type aliases for Non-generic types are almost useless, like the one showed in the PEP 484 Url = str def retry(url: Url, retry_count: int) -> None: ... With the modern syntax, we would have: type Url = str def retry(url: Url, retry_count: int) -> None: ... Which won’t do anything in static analysis: test: str = 'not_an_url' test1 = retry(test) # Doesn't give a static warning test = 'not_an_url' test2 = retry(test) # Doesn't give a warning, but may be nice based on --strict test: Url ...
🌐
CodingNomads
codingnomads.com › python-keywords
Python Keywords
It needs to be in order to correctly interpret your code! This means that you can always ask Python if you want to know what the reserved keywords are. To bring up a list of all keywords in Python, you can ask Python for help() in regards to them:
🌐
Python
docs.python.org › 3 › glossary.html
Glossary — Python 3.14.3 documentation
positional-or-keyword: specifies an argument that can be passed either positionally or as a keyword argument. This is the default kind of parameter, for example foo and bar in the following: ... positional-only: specifies an argument that can be supplied only by position. Positional-only parameters can be defined by including a / character in the parameter list of the function definition after them, for example posonly1 and posonly2 in the following: