Python2 or 3 or both ?
My only ask is to be compatible with python3. I see you had used python 2 style class declarations
class WalletService(object):
....
My order of preference would be
- Python3 code but be usable with both python2 and python3
- Python3 code but be usable with only python3
Does it cause any problems in Python3?
Does it cause any problems in Python3?
It works. There is no issue with that at all.
But when looking at the code to understand what it is doing, not seeing the type annotations is kind of confusing. Or maybe thats just me been using python3 with type annotations for several years now.
Well, I've never used them personally and always described types in the docstring. However, if annotations turn out nicely in auto-generated docs, we might consider that solution.
I'm rather not planning to make the code compatible with Py2, if that matters. Although I'm not considering that decision final.
For doc generation I'd like to use Sphinx
Since python 2 is no longer supported, I would say it's safe to drop python 2 and use just python from e.g. 3.6.
Type annotations are very useful IMHO (linting, refactoring, code navigation). We use them in our IOHK python projects, like https://github.com/input-output-hk/cardano-node-tests and https://github.com/input-output-hk/cardano-clusterlib-py You can see how it looks like in sphinx docs in https://cardano-clusterlib-py.readthedocs.io/en/latest/cardano_clusterlib.html#module-cardano_clusterlib.clusterlib
off topic:
Also tools for automatic code checking and formatting make it easier to contribute, find errors as well as clean code from legacy stuff, like constructs used in old python versions (this class Something(object), etc.). E.g. pre-commit with checks like black, flake8, pyupgrade, ... - https://github.com/input-output-hk/cardano-clusterlib-py/blob/master/.pre-commit-config.yaml