Ethan Furman wrote:
# after new protocol with bytes/str support def zingar(a_path): a_path = fspath(a_path) if not isinstance(a_path, (bytes,str)): raise TypeError('bytes or str required') ...
I think that one would be just def zingar(a_path): a_path = fspath(a_path) because fspath() would presumably check the result for str/bytesness itself. At least I can't think of a reason for it not to, since returning either str or bytes is part of its contract. -- Greg _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com