Closed jspahrsummers closed 4 years ago
Hello Justin, yes I'm interested in more type annotations. Mostly for the publicly exposed parts, to help with type hinting for editors.
I have thought about using dataclasses
when they came out with Python 3.7, but at that time compatibility with Python 3.6 was important. Nowadays there is a dataclasses
backport to Python 3.6 and I think it's a good idea to start using them. Apart from better testibility it will give type hinting and code completion which is currently lacking for Object
fields. There are some tricky parts for implementing them in ib_insync (with order serialization etc) but I have some time now and will start on it.
Just to let you know, these typing hints and dataclasses are now released in v0.9.59. Thanks again!
Awesome, thank you!
I'm interested in adding more comprehensive
typing
support to ib_insync (since it's hard to automate any kind of testing around TWS, static typing can at least catch some mistakes).More than happy to do this and contribute back, but since the pull request could get quite large, wanted to ask a couple of questions ahead of time:
dataclasses
from Python 3.7? This would increase the minimum version requirement of ib_insync from 3.6, but it could take care of a lot of the type introspection behaviors (e.g., those implemented inObject
right now).