[Python-Dev] PEP 572 and assert
Barry Warsaw
barry at python.org
Tue Jul 17 14:48:54 EDT 2018
More information about the Python-Dev mailing list
Tue Jul 17 14:48:54 EDT 2018
- Previous message (by thread): [Python-Dev] PEP 572 and assert
- Next message (by thread): [Python-Dev] PEP 572 and assert
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jul 17, 2018, at 11:34, Tim Peters <tim.peters at gmail.com> wrote: > Assuming the result of list(path.iterdir()) can change over time (seems very likely), > > assert len(list(path.iterdir())) == 0, list(path.iterdir()) > > _could_ end up both triggering and displaying an empty list in the exception detail. The assignment-expression version cannot. Tim, you’re dangerously tempting me into +1 territory. :) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: <http://mail.python.org/pipermail/python-dev/attachments/20180717/acef19ce/attachment.sig>
- Previous message (by thread): [Python-Dev] PEP 572 and assert
- Next message (by thread): [Python-Dev] PEP 572 and assert
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list