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

GenerateClasses.py throws Type Error if CSS classes inherits a class that was already inherited earlier #2

Open
timbatt opened this issue Aug 3, 2021 · 0 comments

Comments

@timbatt
Copy link
Owner

timbatt commented Aug 3, 2021

class CSSClasses:
    class Padding:
        padding = "1em"

    class SeparateContent(Padding):
        padding = "2em" 
        margin = "2em"

    # This causes an error 
    class RandomClass(SeparateContent, Padding):
        # class content
        pass

TypeError: Cannot create a consistent method resolution
order (MRO) for bases object, Padding, SeparateContent

Preferably this should instead warn the user that the class inherits the same class twice, or find a way to join the
class attributes together systematically.

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

No branches or pull requests

1 participant