开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: unexpected keyword argument 'conid' in Contract()


 

The attribute is case sensitive, making conid an unsupported attribute verses conId.

>>> contract = Contract(conId=270639)
>>> contract
Contract(conId=270639)


















On Wednesday, July 10th, 2024 at 3:41 AM, Papageno via groups.io <hjm=pmeonline.net_at_groups_io_k289j40cpxdcc8_4b6s0895@...> wrote:

In the there is an example:?
Contract(conId=270639)
which should return a Contract Object. But I got the error:
Traceback (most recent call last):
? File "...\venv\lib\site-packages\IPython\core\interactiveshell.py", line 3577, in run_code
? ? exec(code_obj, self.user_global_ns, self.user_ns)
? File "<ipython-input-23-8d88e504d067>", line 1, in <module>
? ? Contract(conid=270639)
TypeError: Contract.__init__() got an unexpected keyword argument 'conid'

In the source:
...
@staticmethod
def create(**kwargs) -> "Contract":
"""
Create and a return a specialized contract based on the given secType,
or a general Contract if secType is not given.
"""
...
is no conId.

I thought if I have a conId, I dont need any further Contract description.

Am I wrong or is it a bug?

Regards
Hans

Join [email protected] to automatically receive all group messages.