Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add basic support for PEP 702 (@deprecated).#17476

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

Merged
Merged
Changes from1 commit
Commits
Show all changes
40 commits
Select commitHold shift + click to select a range
f04f4e3
Add basic support for PEP 702 (@deprecated).
tyrallaJul 3, 2024
973bf2d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Jul 3, 2024
a88f4b4
use `type: ignore[deprecated]` when importing `abstractproperty`
tyrallaJul 3, 2024
91612c9
Merge remote-tracking branch 'mypypy/feature/support_deprecated' into…
tyrallaJul 3, 2024
faa4911
accept deprecated.args >= 1
tyrallaJul 4, 2024
101e9b8
": " instead of " - "
tyrallaJul 4, 2024
e3dfacb
only consider `warnings.deprecated` and `typing_extensions.deprecated…
tyrallaJul 4, 2024
cbf7574
note instead of error
tyrallaJul 4, 2024
9a947a5
remove walrusses
tyrallaJul 4, 2024
6d92318
document the new option
tyrallaJul 4, 2024
afa0336
motivate the semantic analyzer
tyrallaJul 4, 2024
7bfb534
`report-deprecated-as-error` instead of `warn-deprecated` and three n…
tyrallaJul 4, 2024
1042c65
fix a typo in error_code_list2.rst
tyrallaJul 4, 2024
978b1a2
additional note when PEP 702 is unsatisfied with the order of `@depre…
tyrallaJul 4, 2024
b0ced07
mention the affected overload
tyrallaJul 4, 2024
a07fc64
Merge remote-tracking branch 'mypypy/feature/support_deprecated' into…
tyrallaJul 4, 2024
b527250
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Jul 4, 2024
f636024
add an annotation required by mypyc
tyrallaJul 4, 2024
63a725e
Merge remote-tracking branch 'mypypy/feature/support_deprecated' into…
tyrallaJul 4, 2024
966ac8b
refactor: create the whole deprecation warning in one place
tyrallaJul 5, 2024
6a7dfe0
refactor: get rid of the `memberaccess` parameter
tyrallaJul 5, 2024
1a40953
refactor: merge `check_deprecated_function` and `check_deprecated_cla…
tyrallaJul 5, 2024
1372e66
refactor: convert `get_deprecation_warning` to `create_deprecation_wa…
tyrallaJul 5, 2024
286371f
prefix the warnings with `class ...`, `function ...`, or `overload ..…
tyrallaJul 5, 2024
6f54dab
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Jul 5, 2024
8c0260e
Consider `CallableType.deprecated` in `__hash__`, `__eq__`, `serializ…
tyrallaAug 27, 2024
cf2dcaf
Add a few fine-grained tests (of which `testAddFunctionDeprecationInd…
tyrallaAug 27, 2024
6a93d6a
Merge branch 'feature/support_deprecated' of https://github.com/tyral…
tyrallaAug 27, 2024
a6d0e59
Move the complete creation process of warning notes from `checker.py`…
tyrallaSep 22, 2024
6163787
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Sep 22, 2024
49ee7a8
Move the `deprecation` attribute from the nodes `CallableType` and `O…
tyrallaSep 28, 2024
250e171
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Sep 28, 2024
09a53d5
Modify function`snapshot_symbol_table` by removing the "CrossRef" sp…
tyrallaSep 29, 2024
31c4296
`typ: SymbolNode` -> `node: SymbolNode`
tyrallaSep 29, 2024
90fb06d
`type_` -> typ
tyrallaSep 29, 2024
beed6a5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot]Sep 29, 2024
8eb2e77
Revert commit 09a53d5b (regarding `astdiff.py` but not `fine-grained.…
tyrallaOct 6, 2024
988bf5f
Merge branch 'master' into feature/support_deprecated
tyrallaOct 6, 2024
80ddc68
Add `testDeprecateFunctionAlreadyDecorated`.
tyrallaOct 6, 2024
d104f26
Add `deprecated` to the `Func` snapshot and adjust test `testDeprecat…
tyrallaOct 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
ConsiderCallableType.deprecated in__hash__,__eq__, `serializ…
…e`, and `deserialize`.
  • Loading branch information
@tyralla
tyralla committedAug 27, 2024
commit8c0260e8b4f529fa9c84cf648c815cf8bcc20e16
4 changes: 4 additions & 0 deletionsmypy/types.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2202,6 +2202,7 @@ def __hash__(self) -> int:
tuple(self.arg_names),
tuple(self.arg_kinds),
self.fallback,
self.deprecated,
)
)

Expand All@@ -2216,6 +2217,7 @@ def __eq__(self, other: object) -> bool:
and self.is_type_obj() == other.is_type_obj()
and self.is_ellipsis_args == other.is_ellipsis_args
and self.fallback == other.fallback
and self.deprecated == other.deprecated
)
else:
return NotImplemented
Expand All@@ -2242,6 +2244,7 @@ def serialize(self) -> JsonDict:
"from_concatenate": self.from_concatenate,
"imprecise_arg_kinds": self.imprecise_arg_kinds,
"unpack_kwargs": self.unpack_kwargs,
"deprecated": self.deprecated,
}

@classmethod
Expand All@@ -2267,6 +2270,7 @@ def deserialize(cls, data: JsonDict) -> CallableType:
from_concatenate=data["from_concatenate"],
imprecise_arg_kinds=data["imprecise_arg_kinds"],
unpack_kwargs=data["unpack_kwargs"],
deprecated=data["deprecated"],
)


Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp