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

[record] IHaveNew.__new__ Self return typehint #23213

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

alangenfeld
Copy link
Member

@alangenfeld alangenfeld commented Jul 24, 2024

it appears that when installed, @record_custom + IHaveNew is assuming __new__ returns None instead of Unknown causing it to believe x is None for x = RunRecord()

explicitly tag __new__'s return to Self to resolve

resolves #23214

How I Tested These Changes

manually made the change in site-packages of installed copy of 1.7.13

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @alangenfeld and the rest of your teammates on Graphite Graphite

@alangenfeld alangenfeld changed the title [record] return Self [record] IHaveNew.__new__ Self return typehint Jul 24, 2024
@alangenfeld
Copy link
Member Author

I am guessing that we don't get this error due to some pyright setting we have on that isn't default? not sure

@alangenfeld alangenfeld merged commit 7a71aa8 into master Jul 25, 2024
1 check passed
@alangenfeld alangenfeld deleted the al/07-24-_record_return_self branch July 25, 2024 14:37
smackesey pushed a commit that referenced this pull request Jul 25, 2024
it appears that when installed, `@record_custom` + `IHaveNew` is
assuming `__new__` returns `None` instead of `Unknown` causing it to
believe `x` is `None` for `x = RunRecord()`

explicitly tag `__new__`'s return to `Self` to resolve

resolves #23214

## How I Tested These Changes

manually made the change in `site-packages` of installed copy of
`1.7.13`
hellendag pushed a commit that referenced this pull request Jul 25, 2024
it appears that when installed, `@record_custom` + `IHaveNew` is
assuming `__new__` returns `None` instead of `Unknown` causing it to
believe `x` is `None` for `x = RunRecord()`

explicitly tag `__new__`'s return to `Self` to resolve

resolves #23214

## How I Tested These Changes

manually made the change in `site-packages` of installed copy of
`1.7.13`
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

Successfully merging this pull request may close these issues.

[1.7.13] type checker thinks RunRequest(...) returns None
3 participants