anvilistas / reactive

signals for anvil
Other
1 stars 0 forks source link

init arguments to reactive class fail #10

Closed meatballs closed 2 days ago

meatballs commented 2 days ago

Passing arguments to a reactive class init raises an error. e.g.

from anvil_reactive.main import reactive_class

@reactive_class
class TestClass:
    def __init__(self, name):
        self.name = name

test = TestClass("meatballs")

raises:

TypeError: object.__new__() takes exactly one argument (the type to instantiate)

    at app/anvil_reactive/main/_reactive_class.py:34

Clone link for an MWE with the code example above: https://anvil.works/build#clone:TYYDSAAN6CCCFTGG=55NWIEQJ3F6HGYVUZPMRZGNI