mirror of
https://github.com/capnproto/pycapnp.git
synced 2025-03-04 08:24:43 +01:00
enable structs to be initialized the Python way
This commit is contained in:
parent
cca14902e1
commit
0f0b30c666
1 changed files with 2 additions and 0 deletions
|
@ -3043,6 +3043,8 @@ class _StructModule(object):
|
|||
:rtype: :class:`_DynamicStructReader`
|
||||
"""
|
||||
return _PackedMessageReaderBytes(buf, traversal_limit_in_words, nesting_limit).get_root(self.schema)
|
||||
def __call__(self, num_first_segment_words=None, **kwargs):
|
||||
return self.new_message(num_first_segment_words=num_first_segment_words, **kwargs)
|
||||
def new_message(self, num_first_segment_words=None, **kwargs):
|
||||
"""Returns a newly allocated builder message.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue