The closest equivalent to listdir in POSIX systems is readdir . Additionally, I’m not in favor of adding parameters to ‘listdir’, but I would do so if forced, rather than adding platform-agnostic functions. They should belong to a C module in CPython, or a C extension.
Technically speaking, a path is neither hidden nor visible; it is just a location. You can inquire whether this location represents a file or a directory, but asking if it is hidden doesn’t make sense to me. Hence, the hidden attribute pertains to a file or directory. It is platform-specific and easily accessible, as described in previous posts.
I would suggest creating a C extension to handle OS differences and publishing the library on PyPi. That way, it may be easier to request inclusion in the standard library based on its popularity of usage.
True, but a lot of pathlib pertains to the thing referenced. You can test if a path exists, see if it’s a file/directory/symlink, etc, etc. None of that is true of the “path” per se, but it’s useful to be able to do those on Path objects.
I would suggest creating a C extension to handle OS differences and publishing the library on PyPi. That way, it may be easier to request inclusion in the standard library based on its popularity of usage.
I only use pure Python libraries for my projects and include them in my repository: GitHub - nineteendo/pyvz2 at alpha. That way the program can be run straight after downloading from GitHub without needing a virtual environment. If you need the libraries outside of the program they can be installed with pip.
No matter how useful your library may be, if it depends on C code, I can’t use it.
This confuses me. If you’re okay with installing arbitrary libraries with pip, why reject those that depend on C code? How is it any different what it’s implemented in? You’re still going to have the potential for collisions or version conflicts.
This confuses me. If you’re okay with installing arbitrary libraries with pip, why reject those that depend on C code? How is it any different what it’s implemented in?
I’m fine with installing python libraries for local projects, but I want my open source programs to be as easy to use. This means they must be cross-platform, don’t require installing libraries and are released as executables for Windows & macOS.
Any third-party libraries that don’t rely on third-party C code can simply be included in the repository itself. I haven’t figured out a way to include these in the project without requiring local compilation.
What I meant was that you can optionally install the dependencies of the project to use them in other scripts. Any third party library will then be installed from PyPi.
You’re still going to have the potential for collisions or version conflicts.