Commit 4dbdde33 authored by Stefan Behnel's avatar Stefan Behnel

write stararg utility functions only when they are used

parent 3cd87370
...@@ -962,9 +962,11 @@ class DefNode(FuncDefNode): ...@@ -962,9 +962,11 @@ class DefNode(FuncDefNode):
self.declare_pyfunction(env) self.declare_pyfunction(env)
self.analyse_signature(env) self.analyse_signature(env)
self.return_type = self.entry.signature.return_type() self.return_type = self.entry.signature.return_type()
if self.star_arg or self.starstar_arg or self.num_kwonly_args > 0: if self.star_arg:
env.use_utility_code(get_stararg_utility_code) env.use_utility_code(get_stararg_utility_code)
if self.starstar_arg:
env.use_utility_code(get_splitkeywords_utility_code) env.use_utility_code(get_splitkeywords_utility_code)
if self.num_required_kw_args:
env.use_utility_code(get_checkkeywords_utility_code) env.use_utility_code(get_checkkeywords_utility_code)
def analyse_signature(self, env): def analyse_signature(self, env):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment