projects
/
platform
/
upstream
/
flatbuffers.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f437f0f
)
Add default to offset param of Python generated GetRootAs (#6312)
author
Richard A Hofer
<rhofer@alumni.cmu.edu>
Mon, 7 Dec 2020 19:34:07 +0000
(14:34 -0500)
committer
GitHub
<noreply@github.com>
Mon, 7 Dec 2020 19:34:07 +0000
(11:34 -0800)
src/idl_gen_python.cpp
patch
|
blob
|
history
diff --git
a/src/idl_gen_python.cpp
b/src/idl_gen_python.cpp
index
1260673
..
70790a5
100644
(file)
--- a/
src/idl_gen_python.cpp
+++ b/
src/idl_gen_python.cpp
@@
-127,7
+127,7
@@
class PythonGenerator : public BaseGenerator {
code += Indent + "@classmethod\n";
code += Indent + "def GetRootAs";
code += NormalizedName(struct_def);
- code += "(cls, buf, offset):";
+ code += "(cls, buf, offset
=0
):";
code += "\n";
code += Indent + Indent;
code += "n = flatbuffers.encode.Get";