AI engineering glossary · Python advanced
What is generic?
Generic (also called Generics): A class or function written to work with many types while keeping type information, using type variables. It lets checkers know that a container of integers returns integers, not just any object.
Generic: an example
list[int] is a generic list holding integers; a checker knows that lst[0] is an int.
Related terms
More Python advanced terms
Where you learn it
Generic is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.