TypeError When Passing Tuple as "pulling" Argument in add_child Method
Description
When trying to add a child to the parent class using the add_child method, a TypeError occurs if the pulling argument is passed as a tuple. The error message suggests that only NoneType
, str
, set
, dict
, and list
are acceptable types for the pulling argument, but the provided code example uses a tuple
.
Proposal
Update this line: https://gitlab.com/cosapp/cosapp/-/blob/master/cosapp/systems/system.py#L1513
from:
check_arg(pulling, 'pulling', (type(None), str, list, dict, set))
to:
check_arg(pulling, 'pulling', (type(None), str, list, dict, set, tuple))
Code to reproduce the bug
from cosapp.systems import System
class Foo(System):
def setup(self):
self.add_inward('a')
self.add_inward('b')
self.add_inward('c')
class Sys(System):
def setup(self):
pulling = ('a', 'b')
self.add_child(Foo('foo'), pulling=pulling)
sys = Sys('sys')