[C++-sig] Re: Pyste bug: can't set different return policies on method

David Abrahams dave at boost-consulting.com
Tue Sep 23 01:17:04 CEST 2003

"Niall Douglas" <s_sourceforge at nedprod.com> writes:

> On 21 Sep 2003 at 14:32, Nicodemus wrote:
>> That's a limitation of Pyste right now. One of the future plans is to
>> allow metaprogramming inside the pyste files, which would allow you to
>> do something like this:
>> FXFile = Class(...)
>> if not FXFile.name.static:
>>     set_policy(FXFile.name, return_internal_reference)
>> But this might take a while to be implemented... I haven't had much
>> time to work on Pyste lately. But what you think of this solution?
> Looks to me like you're making work for yourself.
> How about instead when pyste encounters two methods with the same 
> name it puts an array at FXFile.name ie; now it's FXFile.name[0] and 
> FXFile.name[1]. This ensures you don't accidentally set the policy 
> incorrectly for both when you meant one of them, plus it's much 
> easier to code.

I like that idea.

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list