Message278523
> How about raising a TypeError if ``all(isinstance(l, str) for l in
> fromlist)`` is False? That would make the exception message less clearer
> since we can't include the "[...] not 'bytes'" part though.
for l in fromlist:
if not isinstance(l, str):
raise TypeError(...)
Note also that you can get an arbitrary error if fromlist is not a sequence.
Actually this issue doesn't look very important for Python 3, since it is
unlikely that non-string is passed in fromlist. Unlike to Python 2 where you
can pass unicode if just use unicode_literals. Other solution for Python 2 is
allowing unicode in fromlist. Perhaps this would increase compatibility with
Python 3. |
|
Date |
User |
Action |
Args |
2016-10-12 10:22:15 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, brett.cannon, rhettinger, ncoghlan, ezio.melotti, bignose, eric.snow, berker.peksag, Julian.Gindi, davidszotten@gmail.com, Tim.Graham |
2016-10-12 10:22:14 | serhiy.storchaka | link | issue21720 messages |
2016-10-12 10:22:14 | serhiy.storchaka | create | |
|