Skip to content

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

Open
@timbatt

Description

@timbatt
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.

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