commit 99c3043fddc5397130accf6b8ff3191b96611158 Merge: d1174a83 13e401de Author: Damian Johnson atagar@torproject.org Date: Mon May 11 15:36:14 2020 -0700
Type hints
Now that we require Python 3.5 our library can provide type hints for our IDE users...
https://docs.python.org/3/library/typing.html
Needless to say this is a large overhaul. Dynamic return types and our custom enumerations are incompatible with formal typing, and will get removed from our library in the future.
docs/faq.rst | 15 +- run_tests.py | 10 +- stem/__init__.py | 36 +-- stem/client/__init__.py | 69 ++--- stem/client/cell.py | 144 ++++++----- stem/client/datatype.py | 155 +++++------ stem/connection.py | 71 ++--- stem/control.py | 443 ++++++++++++++++---------------- stem/descriptor/__init__.py | 243 ++++++++++-------- stem/descriptor/bandwidth_file.py | 48 ++-- stem/descriptor/certificate.py | 53 ++-- stem/descriptor/collector.py | 87 ++++--- stem/descriptor/extrainfo_descriptor.py | 71 ++--- stem/descriptor/hidden_service.py | 155 +++++------ stem/descriptor/microdescriptor.py | 26 +- stem/descriptor/networkstatus.py | 174 +++++++------ stem/descriptor/remote.py | 95 +++---- stem/descriptor/router_status_entry.py | 75 +++--- stem/descriptor/server_descriptor.py | 91 ++++--- stem/descriptor/tordnsel.py | 31 ++- stem/directory.py | 59 ++--- stem/exit_policy.py | 158 ++++++------ stem/interpreter/__init__.py | 18 +- stem/interpreter/arguments.py | 175 ++++++------- stem/interpreter/autocomplete.py | 12 +- stem/interpreter/commands.py | 36 +-- stem/interpreter/help.py | 15 +- stem/manual.py | 69 ++--- stem/process.py | 10 +- stem/response/__init__.py | 149 +++++++---- stem/response/add_onion.py | 2 +- stem/response/authchallenge.py | 2 +- stem/response/events.py | 295 +++++++++++++++++---- stem/response/getconf.py | 6 +- stem/response/getinfo.py | 14 +- stem/response/mapaddress.py | 2 +- stem/response/protocolinfo.py | 12 +- stem/socket.py | 104 ++++---- stem/util/__init__.py | 14 +- stem/util/conf.py | 59 +++-- stem/util/connection.py | 74 +++--- stem/util/enum.py | 33 +-- stem/util/log.py | 35 +-- stem/util/proc.py | 36 +-- stem/util/str_tools.py | 50 ++-- stem/util/system.py | 107 ++++---- stem/util/term.py | 18 +- stem/util/test_tools.py | 207 ++++++++++----- stem/util/tor_tools.py | 25 +- stem/version.py | 31 +-- test/arguments.py | 233 +++++++++-------- test/integ/control/controller.py | 8 +- test/integ/response/protocolinfo.py | 8 +- test/mypy.ini | 6 + test/settings.cfg | 42 ++- test/task.py | 15 +- test/unit/client/address.py | 2 +- test/unit/control/controller.py | 6 +- test/unit/descriptor/bandwidth_file.py | 3 +- test/unit/interpreter/arguments.py | 32 +-- test/unit/response/protocolinfo.py | 2 +- test/unit/util/proc.py | 23 +- 62 files changed, 2443 insertions(+), 1856 deletions(-)
tor-commits@lists.torproject.org