[C++-sig] Sorry for my absence
David Abrahams
dave at boost-consulting.com
Sat Mar 12 04:03:06 CET 2005
David Abrahams <dave at boost-consulting.com> writes:
>> This patch attempts to solve the docstring problem via #3 since it seemed
>> the least bad solution of the above three. That said, I'm by no means a
>> python expert, and I don't know what all the ramifications are of overloading
>> the __class__ attribute, I did it this way based on a suggestion from python-
>> dev and it has worked for my needs, but it is definitely a kludge.
>
> I applied it after fixing a few things:
>
> 0. Brace formatting convention
>
> 1. It does something tricky without any comments to explain what's
> happening!!
>
> 2. reinterpret_cast is nonportable and nearly always a no-no.
>
> Thanks for the patch.
Probably a better thing to do would be to fake the __class__ into
being a dummy class derived from PyCFunction_Type, with a noticeably
different name and a big ugly docstring explaining why it exists.
That way anyone looking at the __class__ attribute will have a clue
what's going on. If you could make that patch, I'd appreciate it.
--
Dave Abrahams
Boost Consulting
www.boost-consulting.com
More information about the Cplusplus-sig
mailing list