-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The information in "Duck Typing"'s section "Protocols" doesn't really sound actionable to me. What am I supposed to learn from this? And how can I apply this afterwards? As far as I know, Python doesn't have anything to enforce or abide by protocols explicitly (except for static typecheckers of course), so all you can do is know about it and do my very best to abide by protocols. Could we have this more actionable in some form?
Relatedly, using the Iterator protocol suggests that it could be about figuring out if something is iterable, which is surprisingly challenging/easy (depending on your allowed toolbox) to do reliably due to the different ways of being iterable.
Metadata
Metadata
Assignees
Labels
No labels