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.

Level: advancedTopic: Python advanced

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.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.