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

unionize base var fields types #4153

Merged
merged 8 commits into from
Oct 12, 2024
Merged

unionize base var fields types #4153

merged 8 commits into from
Oct 12, 2024

Conversation

adhami3310
Copy link
Member

class Foo(rx.Base):
    name: str = "foo"


class Bar(rx.Base):
    field: str = "bar"


class State(rx.State):
    @rx.var
    def something(self) -> Foo | Bar:
        return Bar()


print(get_attribute_access_type(Foo | Bar, "name"))

print(State.something.name._var_type)

masenf
masenf previously approved these changes Oct 12, 2024
@masenf masenf merged commit b1d4498 into main Oct 12, 2024
31 checks passed
@masenf masenf deleted the unionize-base-var-fields-types branch October 12, 2024 00:27
Kastier1 pushed a commit that referenced this pull request Oct 23, 2024
* unionize base var fields types

* add tests

* fix union types for vars (#4152)

* remove 3.11 special casing

* special case on version

* fix old versions of python

---------

Co-authored-by: Masen Furer <m_github@0x26.net>
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.

3 participants