-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
additional issue in recently fixed pep-681 fix discovered #15020
Labels
Comments
for reference this is the SQLAlchemy case from sqlalchemy.orm import DeclarativeBase
from sqlalchemy.orm import Mapped
from sqlalchemy.orm import mapped_column
from sqlalchemy.orm import MappedAsDataclass
class User(MappedAsDataclass, DeclarativeBase):
__tablename__ = "user_account"
id: Mapped[int] = mapped_column(init=False)
name: Mapped[str]
fullname: Mapped[str | None] = mapped_column(default=None)
user = User(name="Me", fullname="Myself") # good
user = User(name="Me") # also good
user = User(
name="Me", fullname=None
) |
3 tasks
Closed
2 tasks
Any work being done on this? |
Opened #15628 |
JelleZijlstra
pushed a commit
that referenced
this issue
Jul 9, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi, this is continuing from #14868, a user found another variant which points to something that likely needs to be adjusted in the fix just made in #15006.
same test case as #14868, but we add an additional alternative input type for the setter; the new logic does not interpret "optional" correctly (pyright works):
where the second case, Optional is not unwrapping the inner type correctly:
The text was updated successfully, but these errors were encountered: