Skip to content

Conversation

@Fokko
Copy link
Contributor

@Fokko Fokko commented Jun 15, 2022

Follow up PR of #5008

Metaclasses in Python don't mix very well, and when they cause conflicts then it breaks at initialization.
An example of metaclasses is the ABC, but also the Pydantic BaseModel. I tried to circumvent this by extending the Singleton from ABC but it is likely that we use different metaclasses in the future, and then it will bring us sadness and misery.

Metaclasses in Python don't mix very well, and when they cause
conflicts then it breaks at initialization.
Example of metaclasses is the ABC, but also the Pydantic BaseModel.
I tried to circumvent this by extending the Singleton from ABC
but it is likely that we use different metaclasses in the future,
and then it will bring us sadness and misery.
Copy link
Contributor

@samredai samredai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@danielcweeks danielcweeks merged commit a38e663 into apache:master Jun 15, 2022
@Fokko Fokko deleted the fd-dont-use-metaclass-for-the-singleton branch June 15, 2022 22:30
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
Metaclasses in Python don't mix very well, and when they cause
conflicts then it breaks at initialization.
Example of metaclasses is the ABC, but also the Pydantic BaseModel.
I tried to circumvent this by extending the Singleton from ABC
but it is likely that we use different metaclasses in the future,
and then it will bring us sadness and misery.
namrathamyske pushed a commit to namrathamyske/iceberg that referenced this pull request Jul 10, 2022
Metaclasses in Python don't mix very well, and when they cause
conflicts then it breaks at initialization.
Example of metaclasses is the ABC, but also the Pydantic BaseModel.
I tried to circumvent this by extending the Singleton from ABC
but it is likely that we use different metaclasses in the future,
and then it will bring us sadness and misery.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants