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
if object of type pathlib.Path is used as function argument, clize will complain:
ValueError: Cannot find value converter for default value PosixPath('/foo/bar'). Please specify one as an annotation.
If the default value's type should be used to convert the value, make sure it is decorated with clize.parser.value_converter()
how about add the converter in clize by default? Many of the standard lib in Python3 already changed to support pathlib
The text was updated successfully, but these errors were encountered:
Good call: pathlib is included in Python, and as a bonus it is the way forward in dealing with paths in Python.
After briefly looking at the documentation, it looks like adding pathlib.PurePath as a key to the default converters table should be the best option. If a user wants to force a specific flavor, they must be able to specify one of the platform-specific types as converters.
converters.file already does path checking, but gives you a context manager to open the file instead of a path object. Do you have a use case for validating a path and returning the path?
if object of type
pathlib.Path
is used as function argument, clize will complain:how about add the converter in clize by default? Many of the standard lib in Python3 already changed to support pathlib
The text was updated successfully, but these errors were encountered: