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

[Python] Object API has the wrong name #8422

Open
kojung opened this issue Oct 9, 2024 · 0 comments · May be fixed by #8427
Open

[Python] Object API has the wrong name #8422

kojung opened this issue Oct 9, 2024 · 0 comments · May be fixed by #8427

Comments

@kojung
Copy link

kojung commented Oct 9, 2024

Here's a simple schema:

$ cat test.fbs 
namespace abc;
file_extension "abc";

struct ABCWord {
    w: [uint32:4];
}

table Root {
    words: [ABCWord];
}

root_type Root;

I compile it with the latest version of flatc like this:

$ flatc --version
flatc version 24.3.25

$ flatc --gen-object-api --python test.fbs

In the resulting file abc/ABCWord.py, the function is defined like this:

def CreateABCWord(builder, w):
    builder.Prep(4, 16)
    for _idx0 in range(4 , 0, -1):
        builder.PrependUint32(w[_idx0-1])
    return builder.Offset()

However, the object API calls the above function like this:

class ABCWordT(object):
    # ABCWordT
    def Pack(self, builder):
        return CreateAbcword(builder, self.w)

As we can see, the ABCWordT.Pack() method should call the function CreateABCWord(), not CreateAbcword().

@kojung kojung changed the title Python object API has the wrong name [Python] Object API has the wrong name Oct 13, 2024
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

Successfully merging a pull request may close this issue.

1 participant