KotlinIsland / KotlinIsland/basedmypy
no error when `contextmanager` decorator is above `staticmethod` decorator
- Dominant language
- Python
- Stars
- 202
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the problem, ie expected/actual result (if it's not blatantly obvious)
```
TypeError: Foo.foo() takes 0 positional arguments but 1 was given
```
### Gist to reproduce
```python
from collections.abc import Iterator
from contextlib import contextmanager
class Foo:
@contextmanager
@staticmethod
def foo() -> Iterator[None]:
yield None
def bar(self):
with self.foo():
...
Foo().bar()
```
### Basedmypy version
_No response_
### Command-line flags
_No response_
### Configuration options from `pyproject.toml` (and other config files)
_No response_
### Python version used
_No response_
### Operating system and version
_No response_
Contributor guide
Research direction
Start with the supplied Foo reproducer and investigate basedmypy’s handling of the contextmanager and staticmethod decorator order. Verify the reported TypeError and add a regression check for this case; done when the checker handles the decorator combination as intended.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100