Skip to content

bpo-34775: Return NotImplemented in PurePath division.#9509

Merged
serhiy-storchaka merged 6 commits intopython:masterfrom
aiudirog:master
Aug 8, 2019
Merged

bpo-34775: Return NotImplemented in PurePath division.#9509
serhiy-storchaka merged 6 commits intopython:masterfrom
aiudirog:master

Conversation

@aiudirog
Copy link
Copy Markdown
Contributor

@aiudirog aiudirog commented Sep 23, 2018

Return NotImplemented in PurePath.__truediv__ and PurePath.__rtruediv__ instead of raising a TypeError to allow custom compatible path types.

https://bugs.python.org/issue34775

@the-knights-who-say-ni
Copy link
Copy Markdown

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@aiudirog aiudirog changed the title bpo-NNNN: Return NotImplemented in PurePath division. bpo-34775: Return NotImplemented in PurePath division. Sep 23, 2018
Copy link
Copy Markdown
Contributor

@jdemeyer jdemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a testcase.

@aiudirog
Copy link
Copy Markdown
Contributor Author

I added a fairly simple test case with a basic custom class to test both sides of the operation and ensure a type error is only raised when both sides return NotImplemented. Please let me know if I should expand on it.

Thank you

Comment thread Misc/NEWS.d/next/Library/2018-09-23-03-18-52.bpo-34775.vHeuHk.rst
Comment thread Lib/test/test_pathlib.py Outdated
@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @aiudirog for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@miss-islington
Copy link
Copy Markdown
Contributor

Thanks @aiudirog for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@miss-islington
Copy link
Copy Markdown
Contributor

I'm having trouble backporting to 3.7. Reason: 'Error 110 while writing to socket. Connection timed out.'. Please retry by removing and re-adding the needs backport to 3.7 label.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Aug 8, 2019
@bedevere-bot
Copy link
Copy Markdown

GH-15172 is a backport of this pull request to the 3.8 branch.

ned-deily pushed a commit that referenced this pull request Aug 29, 2019
@ned-deily
Copy link
Copy Markdown
Member

The 3.8 backport was languishing awaiting a merge; I manually merged it in time 3.8.0b4. I would prefer we not backport this to 3.7, given where we are in 3.7's lifecycle as the current behavior has been around for a long time.

lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants