[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-29 Thread Brett Cannon
Brett Cannon added the comment: Changing the semantics of os.path.isdir() for something like this isn't worth breaking code; basically it's now a quirk of the function. -- ___ Python tracker

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Kirill Balunov
Kirill Balunov added the comment: I am reading "equivalence" too strictly (like "as a substitute"), because this is part of the documentation :) and I agree that in ordinary speech I would use it rather in the sense of “similar”. In order to make sure, that everyone agrees only on that this

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: If "equivalent" is deceiving, perhaps replace it with "similary" or "roughly equivalent". Feel free to post a PR with your preferred wording. -- ___ Python tracker

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Brett Cannon
Brett Cannon added the comment: I think you're reading "equivalence" too strictly here to mean "exactly the same semantics". In this instance it means "for similar functionality, the equivalent method is ..." (admittedly this might be a quirk of the use of the word "equivalent" in North

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Kirill Balunov
Kirill Balunov added the comment: I understand the reasons, I only say that it does not correspond to my perception of their equivalence, because: os.path.isdir('') != os.path.isdir('.') while: Path('').is_dir() == Path('.').is_dir() and I can confirm that some libraries rely on

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is because Path() == Path('') == Path('.'). -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Kirill Balunov
Kirill Balunov added the comment: Forgot to write the result for Path variant: >>> Path(dummy).is_dir() True -- ___ Python tracker ___

[issue37688] The results from os.path.isdir(...) an Path(...).is_dir() are not equivalent for empty path strings.

2019-07-26 Thread Kirill Balunov
New submission from Kirill Balunov : In the documentation it is said that os.path.isdir(...) an Path(...).is_dir()are equivalent substitutes. https://docs.python.org/3/library/pathlib.html#correspondence-to-tools-in-the-os-module But they give different result for empty path strings: >>>