Skip to content

AttributeError("'module' object has no attribute 'Declare'",) #136

Open
@jwmelto

Description

@jwmelto

The first pass of parsing a file is reasonable, but leaves a lot of type deduction to the imagination. Now suppose that foo.m.py includes the following structure (where the types have been filled in):

structs = {
    "bar" : {
        "one"   : "int",
        "two"   : "mat",
     },
}

Running m2cpp with this file works just fine.

However, I know that another function is going to use the bar structure, and it accesses member "three". If I try to properly specify the structure as:

structs = {
    "bar" : {
        "one"   : "int",
        "two"   : "mat",
        "three" : "vec",
     },
}

then the next invocation of m2cpp will fail with AttributeError("'module' object has no attribute 'Declare'",). I also notice that there is a leftover .pyc file that isn't there when everything works.

See this isssue on StackOverflow for a hint on where the problem lies.

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