faif / python-patterns

A collection of design patterns/idioms in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gradually add type hints to the examples

rednafi opened this issue · comments

A few examples (like the delegation pattern) can be difficult to understand without type hints. Unless you want to keep backward compatibility with older Python versions, adding type hints can make the intents of the code snippets clearer.

That is a good suggestion. Backward compatibility is not extremely useful, since Python 2.x has reached EOL

Yeah, since you can add the type hints gradually, it shouldn't be problem to convert. I've already added type checking to the delegation pattern and sent a PR.

That is a good suggestion. Backward compatibility is not extremely useful, since Python 2.x has reached EOL

"Le roi est mort, vive le roi" 😉

Closing it since the effort has already started. Thanks @rednafi