Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
tungol committed Dec 22, 2024
1 parent 03cc7f8 commit 44c28b4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions stdlib/@tests/test_cases/check_types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import sys
import types
from collections import UserDict
Expand Down Expand Up @@ -39,3 +41,20 @@
assert_type(item_3, Union[int, str])
# Default isn't accepted as a keyword argument.
mp.get(4, default="default") # type: ignore


# test: `types.DynamicClassAttribute`
class DCAtest:
_value: int | None = None

@types.DynamicClassAttribute
def foo(self) -> int | None:

Check failure on line 51 in stdlib/@tests/test_cases/check_types.py

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Method declaration "foo" is obscured by a declaration of the same name (reportRedeclaration)
return self._value

@foo.setter
def foo(self, value: int) -> None:

Check failure on line 55 in stdlib/@tests/test_cases/check_types.py

View workflow job for this annotation

GitHub Actions / Test typeshed with pyright (Linux, 3.12)

Method declaration "foo" is obscured by a declaration of the same name (reportRedeclaration)
self._value = value

@foo.deleter
def foo(self) -> None:
self._value = None

0 comments on commit 44c28b4

Please sign in to comment.