Serhiy Storchaka <[email protected]> added the comment:
I disagree. This is an old API, a thin wrapper around standard POSIX API, and
returning an empty string instead of None will make impossible to distinguish
NULL from "".
It is easy to convert None in an empty string in Python: `value or ''`.
I would change the test to
if field is not None:
self.assertIsInstance(field, str)
or
self.assertIsInstance(field, (str, type(None)))
(I prefer the former variant).
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue32033>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com