Repository navigation
Commit 7c80fd0
committed
[ldap3] Annotate generator functions as returning iterators
`paged_search_generator`, `PersistentSearch.funnel` and
`ADPersistentSearch.funnel` are generators, but were declared `-> None`,
so iterating them was a type error:
for entry in paged_search_generator(conn, base, "(objectClass=*)"):
...
# error: "None" has no attribute "__iter__" (not iterable)
All three yield outside any nested function in ldap3 2.9.1:
`paged_search_generator` yields entries off the response list, and both
`funnel` methods yield search result entries. Annotated
`Iterator[Incomplete]` to match the element type the rest of these stubs
use; the sibling `next` methods are deliberately left unannotated as
they already were.
stubtest reports the same single pre-existing error before and after
(`ldap3.protocol.sasl.kerberos` needs the optional gssapi package), and
mypy reports the same 25 pre-existing pyasn1 import errors. pyright is
clean.1 parent 13ffe24 commit 7c80fd0
3 files changed
Lines changed: 8 additions & 3 deletions
File tree
- stubs/ldap3/ldap3/extend
- microsoft
- standard
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
1 | 4 | | |
2 | 5 | | |
3 | 6 | | |
| |||
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | | - | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
0 commit comments