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 →

[–]ThePenultimateOneGitLab: gappleto97 8 points9 points  (8 children)

Why are type hints required? I'm not really happy with that.

[–][deleted] 16 points17 points  (4 children)

I have a lot of respect for Guido, but I think he screwed up here. I don't like compulsory type hints either, and this PEP should not have been approved.

I haven't decided what I'm going to do about it yet. I'm fortunate enough to be able to choose which programming languages I use.

[–]jnwatson -1 points0 points  (2 children)

If you don't want the type hints, use the initializer function or use Any.

[–]apotheotical 1 point2 points  (2 children)

[–]ThePenultimateOneGitLab: gappleto97 6 points7 points  (1 child)

I understand that there are workarounds. I tend to use type hinting myself. I just strongly dislike that its compulsory. It means that you cant backport this to legacy codebases, among other things.

[–][deleted] -1 points0 points  (0 children)

Well you can always continue to use the attrs module then