-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add signature for dataclasses.replace #14849
Merged
ilevkivskyi
merged 49 commits into
python:master
from
ikonst:2023-03-06-dataclasses-replace
Jun 17, 2023
+389
−3
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
6dbaf9c
Add signature for dataclasses.replace
ikonst 4dcbe44
add ClassVar
ikonst 7ed3741
prevent misleading note
ikonst 89257b5
stash in a secret class-private
ikonst 32b1d47
fix typing
ikonst 1f08816
docs and naming
ikonst c456a5f
inst -> obj
ikonst 8118d29
add the secret symbol to deps.test
ikonst 789cb2b
language
ikonst 9f0974c
nit
ikonst a37e406
nit
ikonst 367c0e9
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 0e84c4f
make obj positional-only
ikonst 9cfc081
Merge branch '2023-03-06-dataclasses-replace' of https://github.com/i…
ikonst 7b907cf
add pythoneval test
ikonst 985db60
use py3.7 syntax
ikonst 15dbb7b
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 3227fde
Fix lint
ikonst 2dbf249
use syntactically invalid name for symbol
ikonst b32881c
Merge branch '2023-03-06-dataclasses-replace' of https://github.com/i…
ikonst 26056a4
Merge remote-tracking branch 'origin/master' into 2023-03-06-dataclas…
ikonst 40315b7
mypy-replace must use name mangling prefix
ikonst c005895
Generic dataclass support
ikonst d71bc21
add fine-grained test
ikonst d914b94
disable for arbitrary transforms
ikonst 2cb6dee
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 5735726
fix testDataclassTransformReplace
ikonst d38897e
better error message for generics
ikonst 04f0ee3
add support for typevars
ikonst f402b86
streamline
ikonst 306c3f3
self-check
ikonst 9b491f5
Merge remote-tracking branch 'origin/master' into 2023-03-06-dataclas…
ikonst 283fe3d
Add improved union support from #15050
ikonst 29780e9
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 9c43ab6
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 94024ba
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 70240c4
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 99bf973
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 8fe75a7
add to testReplaceUnion
ikonst bea50e8
testReplaceUnion: fix B.y to be int
ikonst cd35951
rename testcase replace to testReplace
ikonst d71a7c0
Merge remote-tracking branch 'origin/master' into 2023-03-06-dataclas…
ikonst 957744e
Merge branch 'master' into 2023-03-06-dataclasses-replace
ikonst 6abf6ff
Merge remote-tracking branch 'origin/master' into pr/ikonst/14849
ikonst 4c4fc94
remove get_expression_type hack
ikonst be4a290
assert isinstance(replace_sig, ProperType)
ikonst ee0ae21
add a TODO for _meet_replace_sigs
ikonst 3f656f8
Merge remote-tracking branch 'origin/master' into 2023-03-06-dataclas…
ikonst 65d6e89
Merge remote-tracking branch 'origin/master' into 2023-03-06-dataclas…
ikonst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like hack. Is this because the plugin systems expects a
CallableType
returned from the plugin? Maybe we can instead relax this expectation and allow returning say a union of callable types?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh, that's an interesting idea. It didn't cross my mind I could return a union of callables and let mypy handle it in
check_union_call
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
p.s. I'll be happy to simplify this code, but do you reckon we should first change the plugin API and then rework this PR, or merge as-is, change plugin API and then refactor?
(A bit worried the devil's in the details and that maybe it's not as easy as it sounds, or not equivalent.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to do it in a follow up PR, but leave a TODO or open an issue (or both).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#15457