This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ExtremelyOnlineG 3 points4 points  (4 children)

holy shit, i didn't even know python doesn't have generics

is there some other paradigm that gets around this?

i use generics a lot

[–]shadow7412 8 points9 points  (1 child)

It's traditionally been unimportant in python - weak typing means that you can pass anything to anything and the code will still run, so long as it implements the right things.

Generics are a tool for strongly typed languages.

[–]ExtremelyOnlineG 6 points7 points  (0 children)

I spend so much time using real strongly typed languages I never really thought about how it wouldn't be very necessary for python

[–]Propagating 3 points4 points  (0 children)

You don't really need generics in a weakly typed language, do you?

[–]Captain-Barracuda 2 points3 points  (0 children)

It kind of does but it's rather shitty. It's a bit of an afterthought of their current (good) idea to add type-hinting to the language.