Skip to content

attr-defined not working on werkzeug.wrappers.BaseRequest childs #3913

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

Closed
LarsMichelsen opened this issue Apr 7, 2020 · 0 comments
Closed

Comments

@LarsMichelsen
Copy link
Contributor

The PR #2740 added __setattr__ and __getattr__ to the werkzeug.wrappers.BaseRequest definition.

def __setattr__(self, name: str, value: Any): ...

I have seen the comment about the change, but I cannot understand why this is a good way to go. This class is often used as parent class. No attribute checks can be made in any child class.

Can we please remove these definitions?

LarsMichelsen added a commit to Checkmk/checkmk that referenced this issue Apr 7, 2020
A __setattr__ and __getattr__ in werkzeug.wrappers.BaseRequest
break the attr-defined check.

Change-Id: Ib45b8cd19912fcbe1de5c8f6ccc1b05f001bfb5f
See: python/typeshed#3913
LarsMichelsen added a commit to LarsMichelsen/typeshed that referenced this issue Apr 14, 2020
…n#3913)

The PR python#2740 added __setattr__ and __getattr__ to the
werkzeug.wrappers.BaseRequest definition to silence mypy when
monkeypatching this class.

The change disabled the errors for monkeypatching, but disabled disabled the
important check attr-defined.
vishalkuo pushed a commit to vishalkuo/typeshed that referenced this issue Jun 26, 2020
…n#3913) (python#3925)

The PR python#2740 added __setattr__ and __getattr__ to the
werkzeug.wrappers.BaseRequest definition to silence mypy when
monkeypatching this class.

The change disabled the errors for monkeypatching, but disabled disabled the
important check attr-defined.
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

No branches or pull requests

1 participant