Not. Python is not a statically typed language, so there is no need for them. Java generators provide only compile-time type protection; they do nothing at runtime. Python has no compile-time type security, so it would be pointless to add generics to leverage compile-time type checks that Python does not exist.
The list, for example, is an untyped collection. There is no equivalent to the difference between List<Integer> and List<String> , because a Python list can store any type of object.
John kugelman
source share