3 ms·
The key would be that 'you sometimes want it'. The stuff that `zope.interface` gets you is honestly on the... heavy side of what I think makes sense for a lot
by icegreentea2 6y ago
The key would be that 'you sometimes want it'.
The stuff that `zope.interface` gets you is honestly on the... heavy side of what I think makes sense for a lot of scenarios (especially in Python). Which would explain it's relatively low uptake despite having been around for like... 15-20 years??
I haven't used `typing.Protocol` yet (I am mostly still working in 3.7), but it seems to roughly capture the level of 'heaviness' that seems workable.
I do get your gist though. Sometimes I wonder what I'm doing type annotating stuff.
- psd1 6y ago> I do get your gist though. Sometimes I wonder what I'm doing type annotating stuff. I have to say, I despise trying to decipher untyped functions. This arg is called "order" - do you want an instance of Order, an order ID, or a function for sorting? Fine, I'll read the docstring. Instead of using the IDE.
- BerislavLopac 6y ago> I haven't used `typing.Protocol` yet (I am mostly still working in 3.7) You can use it if you install the typing-extensions package: https://pypi.org/project/typing-extensions/ https://pypi.org/project/typing-extensions/