From: Jeffrey C. O. <je...@ol...> - 2000-11-17 15:56:39
|
On Fri, Nov 17, 2000 at 03:34:54PM +0100, David Leonard wrote: >=20 > eg ufn_search_s() might be #ifdef'd out and some python program that wan= ts > to use it will get a NameError when it tries to use it. A better exception > would be NotImplementedError. I don't have a huge problem with that. > A similar problem arises with 'constants'.. I'm not sure what to do here.. > make all undefined cosntants equal None? No, as this will cause problems that are harder to debug as None may be a valid parameter in some cases. If you let NameError exceptions be raised you can immediately track down the offending reference. I don't think that adding code to raise NotImplementedError in the case of undefined constants buys you anything but code bloat. > also there should be some nice way of reliably determining the > underlying library's api version ... maybe _ldap.api_version... > any suggestions on how that might be done nicely are welcome. I'd suggest using LDAP_API_VERSION, LDAP_VENDOR_NAME, and LDAP_VENDOR_VERSION. There are also some miscellaneous LDAP_API_FEATURE* macros. Jeff P.S. Konstantin: I didn't receive a copy of your e-mail with the patches, could you try sending it again? |