Closed albu-diku closed 1 week ago
Thanks @albu-diku. Merged through svn with minor adjustments.
Mainly added a few docstrings/comment and copied our explanation for going against PEP8 in the use of type
comparisons instead of isinstance
in unicode string detection. It originates from the similar helper in mig.shared.base
and basically boils down to compatibility issues across python versions with future
and futurize
in the mix.
Work since the introduction of ensure_native_string() has shown that being able to make use the function is limited by its inclusion of the base package. Allow the function to be used everywhere by using only the Python standard library for its operation.
This sidesteps any potential for circular imports and ensures well tested string conversion is available for the definition of e.g. base itself.