-
Notifications
You must be signed in to change notification settings - Fork 104
chore(python): add type hints and minor changes #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rebase on the latest master and configure a mypy tox build to validate the type annotations? Just running mypy locally shows 59 errors.
0565a58
to
6306036
Compare
I rebased the onto |
6306036
to
6f2b20b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please split the PR further, so that this PR is only focused on adding type hints. There are good changes in the suggested “minor changes”, but they should be proposed separately. The history (and reviews) are much easier to follow when changes are small, accompanied by a rationale explaining why the changes bring an improvement. It also facilitates bisecting later issues.
96c72b5
to
2936d9f
Compare
I've created a new PR (#231) to spilt this PR further up. This PR still contains some minor changes (AbstractLDAPSearch and LDAPSettings) in order to achive "good" type hints. |
2936d9f
to
05f89c9
Compare
- add python 3.6+ type hints - replace applying defaults dict in LDAPSettings with actual variables, allowing type hints, checking if variable exists (e.g. IDE), and preventing supplied defaults dict (LDAPSettings.__init__) to inject undesired variables - add AbstractLDAPSearch as abstract base class - fix (by removing) result of search_s not being checked if None in LDAPSearch.execute - add conversion to string in AbstractLDAPSearch._escape_filterargs - rename AbstractLDAPSearch._begin(...) to AbstractLDAPSearch._search(...) and AbstractLDAPSearch._results(...) to AbstractLDAPSearch._result(...) - add AbstractLDAPSearch._abandon(...) - LDAPSearch._search(...) saves the msgid inside the object instead of returning it - make LDAPGroupType abstract - MemberDNGroupType.is_member(...) now returns bool instead of Union[bool, int] - remove kwargs from LDAPGroupQuery.__init__ - update test mocks corresponding to the AbstractLDAPSearch changes
05f89c9
to
f2aa311
Compare
Important: this PR only exists to split up the PR #208