[python-ldap] Supporting syncrepl (and fixing LDAPObject.results{, 2, 3, 4})

Ondřej Kuzník ondra at mistotebe.net
Wed Mar 16 07:15:36 EDT 2022


On Tue, Mar 15, 2022 at 05:20:43PM +0100, Petr Viktorin wrote:
> FWIW, the general way to upgrade from tuples to objects with attributes in C
> is PyStructSequence [1], the implementation of os.stat_result or
> sys.float_info. Unlike a Python namedtuple, it allows named-only attributes.
> So the result() return value could continue to be a backwards-compatible
> 2-tuple but have all other relevant attributes as well.

Thanks, that is a really useful tip, I'll keep that in mind since it's
going to come up again. The change in exception behaviour can't be done
in results4 so I think we need a new endpoint anyway. On the other hand
it makes it really tempting to adopt this approach too if migrating from
old results API to the new one is made substantially smoother.

Regards,

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP


More information about the python-ldap mailing list