#48 timeval options do not have symmetric set/get

open
nobody
None
5
2009-08-17
2009-08-17
David Leonard
No

When setting OPT_TIMEOUT or OPT_NETWORK_TIMEOUT options, you can specify a negative number which is converted to a NULL timeval pointer internally.
However, when getting the same options, a NULL is turned into the None object (and not a negative number).

There should be some symmetry here for people (like me) who assume they can write code like this:

saved_val = _ldap.get_option(_ldap.OPT_TIMEOUT)
try:
_ldap.set_option(_ldap.OPT_TIMEOUT, 1000)
...
finally:
_ldap.set_option(_ldap.OPT_TIMEOUT, saved_val)

Discussion