-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename some methods in the os module #19110
Conversation
The name "make_absolute" is too generous to hold a specific meaning. At least it should contain "path". It seems that "abspath" is a common and concise name. [breaking-change]
The method names in the os module generally follow the POSIX-like convention, such as setenv, getenv, getcwd, and errno. As os::change_dir() internally uses libc::chdir() on Unix, it would be a good idea to follow the same convention. [breaking-change]
I know that @aturon has been focused on Additionally, the |
+1 for Alex's comment. I think internal naming consistency is more desirable than following Python/Unix convention. |
I'm just a bit confused of dealing with the different conventions at the same time. If we can use the descriptive names for other methods in the But I also think that if we are to unify the names into the descriptive fashion, the required changes should be larger than the reverse. So I think sticking to POSIX is still a viable option. One thing to note, which is slightly (not?) related to this problem is, that the reason why |
Yes there are definitely conflicting conventions throughout I also agree that |
Does @aturon have a formal RFC for naming conventions like this yet? |
Not that I know of, but I'm sure it's coming down the pike! |
Closing due to inactivity, but as an update @aturon and I gave a close look to the |
This pull request feels a bit bikeshedding, but I think it is necessary.
os::make_absolute()
->os::abspath()
: The name "make_absolute" is too generous to hold a specific meaning. At least it should contain "path". It seems that "abspath" is a common and concise name. (Also used in Python.)os::change_dir()
->os::chdir()
: The method names in the os module generally follow the POSIX-like convention, such as setenv, getenv, getcwd, and errno. Asos::change_dir()
internally useslibc::chdir()
on Unix, it would be a good idea to follow the same convention.