Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
fix(types): get the os.PathLike type as correctly as possible#1227
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This should make our internal PathLike type compatible with Python <3.6 and < 3.9.
Switched away from |
Thanks, very elegant! I find it interesting that all PathLike types seem to use |
FYI: this is thetype annotation definition of |
Hmm. Does that mean you think it should accept |
Byron commentedApr 24, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I would refrain from doing anything that reduces convenience or being idiomatic or that is breaking just to gain correctness. To me the whole encoding topic in GitPython is a lost cause as correctness could (to my mind) only be achieved if the API doesn't use strings (with encoding) to handle them. And by the looks of it, it's idiomatic to do that, too: # py 3.8>>> type(os.listdir('.')[0])<class'str'> Edit: On the bright side, I believe just today I had an epiphany which helps me to see a future for GitPython, leveraging it as a strength and not seeing it as a burden. So I hope this will change my mindset too when helping to maintain it in the midterm until such a future can be realized. |
Uh oh!
There was an error while loading.Please reload this page.
This should make our internal PathLike type compatible with Python < 3.6 and < 3.9.
Fixes#1219