[C++-sig] Re: property and documentation
Roman Yakovenko
romany at actimize.com
Tue Aug 5 18:03:42 CEST 2003
> Well, it isn't fair to simply copy the effects of add_property; they
> don't have the same semantics.
1. There is no difference in function definitions except their names.
2. The difference is
Effects: Creates a new Python property class instance, passing object(fget) (and object(fset) in the second form) to its constructor, then adds that property to the Python class with the given attribute name.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^
If you meant smth different, then I don't understand.
Also I send you 2 files. I believe that I checked all cases.
Also I believe that you will find some things that I will have to fix.
(Life is not easy as I'd like to be.)
Roman.
> -----Original Message-----
> From: David Abrahams [mailto:dave at boost-consulting.com]
> Sent: Tuesday, August 05, 2003 3:06 PM
> To: c++-sig at python.org
> Subject: [C++-sig] Re: property and documentation
>
>
> "Roman Yakovenko" <romany at actimize.com> writes:
>
> > Yes. class.html is edited file. class_orig.html is file from cvs.
>
> Well, it isn't fair to simply copy the effects of add_property; they
> don't have the same semantics.
>
> > If you need also tests in C++ and in Python I can write it.
>
> Yes, please. A patch to one of the existing tests would probably be
> best.
>
> > Thanks for the answer.
> >
> > Roman
> >
> >> -----Original Message-----
> >> From: David Abrahams [mailto:dave at boost-consulting.com]
> >> Sent: Tuesday, August 05, 2003 1:02 PM
> >> To: c++-sig at python.org
> >> Subject: [C++-sig] Re: property and documentation
> >>
> >>
> >> "Roman Yakovenko" <romany at actimize.com> writes:
> >>
> >> > Hi.
> >> > 1. add_static_property - function of class_ is not
> >> referenced in documentation.
> >> > Nevertheless it works pretty good.
> >>
> >> Would you like to suggest a documentation patch?
> >>
> >> > 2. How can I specify return value policy for properties ?
> >>
> >> Just use make_function explicitly on the get function and your call
> >> policy and pass the result on to add_property.
> >>
> >> --
> >> Dave Abrahams
> >> Boost Consulting
> >> www.boost-consulting.com
> >>
> >>
> >> _______________________________________________
> >> C++-sig mailing list
> >> C++-sig at python.org
> >> http://mail.python.org/mailman/listinfo/c++-sig
> >>
> >
> >
> > _______________________________________________
> > C++-sig mailing list
> > C++-sig at python.org
> > http://mail.python.org/mailman/listinfo/c++-sig
>
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: properties.cpp
Type: application/octet-stream
Size: 1931 bytes
Desc: properties.cpp
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030805/a4dab8ee/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: properties.py
Type: application/octet-stream
Size: 1145 bytes
Desc: properties.py
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030805/a4dab8ee/attachment-0001.obj>
More information about the Cplusplus-sig
mailing list