Skip to content

Parent classes cannot be reloaded #9

@AlexVillarra

Description

@AlexVillarra

Hello, I encounter the following error "TypeError: init() takes 2 positional arguments but 4 were given" whenever I import the classes in a package I'm coding.
I get the previous error whenever I define a Child class, which inherits form a decorated Parent Class using autoreload, regardless if the Child class is decorated or not.
In reality I would like to decorate both classes since in my project I'd be heavily adjusting both.
I was wondering if this is simply not possible, if it is a mistake on my part, or if its a fixable error?

I'm currently using reloadr-0.4.1 and python 3.8.2

Here is a simple example that reproduces the behavior.

from reloadr import autoreload
@autoreload
class Example_Parent():
    def __init__(self, *args, **kwargs):
        self.example_parent = "example parent"

class Example_Child(Example_Parent):
    def __init__(self, *args, **kwargs):
        super().__init__
        self.example_child = "example child"

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions