You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.6 finally implements PEP 519. This means we can use pathlib.Path instances in standard library methods that expect a string path. For example we can do
a_path = Path('/home/dmwyatt/some_file.txt')
with open(a_path) as f:
file_contents = f.read()
At a minimum, I recommend supporting passing path-like objects into read_env. You can check if an object is a path-like object by using isinstance(a_path, os.PathLike). In the case of read_env you can probably do isinstance(env_file, (string_types, os.PathLike)). You'd have to special-case for Python 3.6 vs Python <3.6.
Eventually, I think the whole Path class as implemented by this library can go away.
The text was updated successfully, but these errors were encountered:
Python 3.6 finally implements PEP 519. This means we can use
pathlib.Path
instances in standard library methods that expect a string path. For example we can doAt a minimum, I recommend supporting passing path-like objects into read_env. You can check if an object is a path-like object by using
isinstance(a_path, os.PathLike)
. In the case ofread_env
you can probably doisinstance(env_file, (string_types, os.PathLike))
. You'd have to special-case for Python 3.6 vs Python <3.6.Eventually, I think the whole
Path
class as implemented by this library can go away.The text was updated successfully, but these errors were encountered: