On 04/18/18 17:33, Raymond Hettinger wrote:
On Apr 16, 2018, at 5:43 PM, Tim Peters <tim.pet...@gmail.com> wrote:
BTW, if _`Counter * scalar` is added, we should think more about
oddball cases. While everyone knows what _they_ mean by "scalar",
Python doesn't.
I've started working on an implementation and several choices arise:
1) Reject scalar with a TypeError if scalar is a Counter
2) Reject scalar with a TypeError if scalar is a Mapping
3) Reject scalar with a TypeError if scalar is a Collection
4) Reject scalar with a TypeError if scalar is Sized (has a __len__ method).
Why is Iterable (__iter__) not on the list?
(Apologies if I missed this somewhere in the conversation.)
I lean toward rejecting all things Sized because _everyone_ knows that scalars
aren't sized ;-)
Raymond
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/