Skip to content
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

attrs copy.replace() support #18304

Open
injust opened this issue Dec 17, 2024 · 0 comments
Open

attrs copy.replace() support #18304

injust opened this issue Dec 17, 2024 · 0 comments
Labels
feature topic-attrs topic-plugins The plugin API and ideas for new plugins

Comments

@injust
Copy link

injust commented Dec 17, 2024

Bug Report

attrs 24.3.0 added support for __replace__ in python-attrs/attrs#1383. Mypy doesn't like it.

To Reproduce

import copy

from attrs import define


@define
class Foo:
    one: int


foo = Foo(1)
bar = copy.replace(foo, one=2)

Actual Behavior

a.py:12: error: Value of type variable "_SR" of "replace" cannot be "Foo"  [type-var]

Your Environment

  • Mypy version used: 1.13.0
  • Mypy command-line flags: mypy .
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.13.1
Package           Version
----------------- -------
attrs             24.3.0
mypy              1.13.0
mypy-extensions   1.0.0
typing-extensions 4.12.2
@injust injust added the bug mypy got something wrong label Dec 17, 2024
@brianschubert brianschubert added topic-plugins The plugin API and ideas for new plugins topic-attrs feature and removed bug mypy got something wrong labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-attrs topic-plugins The plugin API and ideas for new plugins
Projects
None yet
Development

No branches or pull requests

2 participants