Skip to content

Add modules #17

Description

@emptybutton

Need to implement a constructor with similar behavior:

@module
class something:
    a = 5

    def add(a):
        return a * 2

    @val
    class sub_value:
        def add(module, b):
            return module.a + b

        class sub_sub_value:
            def add(module, b):
                 return module.a + b

    @obj
    class sub_object:
        c = 2

        def add(module, self, b):
            return (module.a + b) * self.c

    @module
    class sub_module:
        b = 4

        def add(module, b):
            return module.a + b

        @val
        class sub_sub_value:
            def add(module, sub_module, c):
                return module.a + sub_module.b + c

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestobjectsobjects.py

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions