Should NoneType be iterable?

Chris Angelico rosuav at gmail.com
Tue Jun 20 20:09:18 EDT 2023


On Wed, 21 Jun 2023 at 09:59, Cameron Simpson via Python-list
<python-list at python.org> wrote:

> I wasted some time the other evening on an API which returned a string
> or None. My own API, and the pain it caused tells me that that API
> design choice isn't good (it's an automatic attribute based on a tag,
> returning None if the tag isn't there). My experience so far is that it
> _looks_ handy so that you can safely say "foo.bar" all the time, but as
> soon a you do something with the value you're in for a world of
> None-checking.
>
https://peps.python.org/pep-0505/

ChrisA


More information about the Python-list mailing list