Skip to content

Comment on Python 2.8 Un-release Scheduleparent

Comments

Why then is len special? Should we also have builtins to add to a collection?

If it is good design there, should others repeat it? For example, if a module author is defining a new protocol for a set of objects that anyone can implement should they provide functions that delegate to the methods in their protocol?

For myself I think that the python community can be counted on to be consistent without the need for this duplication and indirection.

> Should we also have builtins to add to a collection?

No, because each collection type (mapping, sequence, set, ...) has very different addition semantics (and potentially arguments as well). On the other hand, there is a builtin to iterate over stuff.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.