Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork966
fix(types): get the os.PathLike type as correctly as possible#1227
fix(types): get the os.PathLike type as correctly as possible#1227Byron merged 1 commit intogitpython-developers:mainfrommuggenhor:fix/pathlike-type
Conversation
This should make our internal PathLike type compatible with Python <3.6 and < 3.9.
muggenhor commentedApr 23, 2021
Switched away from |
Byron commentedApr 23, 2021
Thanks, very elegant! I find it interesting that all PathLike types seem to use |
muggenhor commentedApr 23, 2021
FYI: this is thetype annotation definition of |
muggenhor commentedApr 24, 2021
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