Repository navigation
Conversation
b9da2f8 to
df75b45
Compare
|
Please have a look - only the syncrepl change is questionable: it adds protocol semantics explicitly which exists implicitly. We can skip it as well. |
| self, | ||
| msgid: int = ldap.RES_ANY, | ||
| all: int = 1, | ||
| all: bool = True, |
There was a problem hiding this comment.
These bool annotations reject supported calls such as result(all=0), result4(all=ldap.MSG_ALL), and search_s(.., attrsonly=1).
Could we retain int for the existing integer flag parameters while keeping the boolean defaults? That also preserves MSG_RECEIVED (whose value is 2)
There was a problem hiding this comment.
ah, thanks I didn't knew about LDAP_MSG_RECEIVED yet - it's useful for my async stuff.
I would change it into bool | int = True/False then, because that makes the intention more clear.
There was a problem hiding this comment.
What about the type alias? See 1f574ef
LDAPMessageMode = Literal[0, 1, 2] | bool
"""The type of a message retrieval mode (:const:`ldap.MSG_ONE`, :const:`ldap.MSG_ALL`, or :const:`ldap.MSG_RECEIVED`)."""
or should bool be dropped?
1f574ef to
4863a85
Compare
the attributes must be annotated as ClassVar as the parent defines it as such. Type checkers complain about the generated stubgens: > error: Cannot override class variable (previously declared on base class "SchemaElement") with instance variable > error[invalid-attribute-override] Invalid override of attribute `schema_attribute`: instance variable cannot override class variable `SchemaElement.schema_attribute`
No description provided.