MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / constructor

Method constructor

bindings/frankenswig/struct.py:137–149  ·  view source on GitHub ↗
(self, rust_method, args, docs='', result=False)

Source from the content-addressed store, hash-verified

135 self.pyextra_ = []
136
137 def constructor(self, rust_method, args, docs='', result=False):
138 method = f'{self.module}::{self.name}::{rust_method}'
139 ret = self.type.result() if result else self.type
140
141 self.constructor_ = Function(
142 ret,
143 f'new_{self.c_name}',
144 args,
145 make_safe_call(ret, method, args),
146 docs=docs
147 )
148
149 return self
150
151 def pyextra(self, value):
152 self.pyextra_.append(value)

Callers 1

generate.pyFile · 0.80

Calls 3

FunctionClass · 0.85
make_safe_callFunction · 0.85
resultMethod · 0.80

Tested by

no test coverage detected