On 14/10/2019 12:13, Steve Jorgensen wrote:
A scalar is not just str or bytes though. It is also anything else
that's not a collection, so numbers, dates, booleans, and instances
of any other classes (standard or custom) that are not collections. A
string is just one of the few examples of something that is a
collection but should be treated as a scalar by anything that asks
whether it is one.

In practice I find that's almost never what I want. In the incredibly rare event that I'm throwing a string at an overly generic interface, I almost always want it to be treated as a sequence of characters. If I'm the one writing the overly generic interface, I usually apply the Well Don't Do That Then principle :-)

--
Rhodri James *-* Kynesim Ltd
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/PXXIHYDGSFFCNMD532INJBLRJQM43JRK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to