Skip to content
This repository was archived by the owner on Dec 26, 2024. It is now read-only.
This repository was archived by the owner on Dec 26, 2024. It is now read-only.

Defining __init__() with super() on DualBaseModel subclass raises TypeError  #6

Open
@r4victor

Description

@r4victor

I have some pydantic models that define custom __init__() with a call to super(). When migrating to DualBaseModel as my base model, defining such models started to raise TypeError. Here's the minimal example that reproduces the issue:

from pydantic_duality import DualBaseModel

class MyModel(DualBaseModel):
    one: str
    two: str

    def __init__(self, **kwargs):
        super().__init__(**kwargs)

And the traceback:

Traceback (most recent call last):
  File "pyduality.py", line 4, in <module>
    class MyModel(DualBaseModel):
TypeError: __class__ set to <class '__main__.MyModelRequest'> defining 'MyModel' as <class '__main__.MyModel'>

The problem only occurs when having super() inside __init__(). Tested with Python 3.11.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions