Should NoneType be iterable?

Cameron Simpson cs at cskk.id.au
Tue Jun 20 20:44:52 EDT 2023


On 21Jun2023 10:09, Chris Angelico <rosuav at gmail.com> wrote:
>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/


Hmm. Thanks. - Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list