[Zope-Perl] Python void context
Chris McDonough
chrism@digicool.com
Fri, 26 May 2000 10:23:28 -0400
It occurs to me that you could define a context default keyword argument
to the Perl function e.g.
obj.func(1,2,context="list")
obj.func(1,2,context="scalar")
obj.func(1,2,context="void")
Where func's signature defines context as a default:
func(self, arg1, arg2, context="list")
This seems to be the 'pythonic' way of dealing with such a thing. I'm
not sure how you're implementing a Perl function wrapper, so I'm not
sure if this suits you.
> -----Original Message-----
> From: Chris McDonough [mailto:chrism@digicool.com]
> Sent: Friday, May 26, 2000 10:01 AM
> To: 'Gisle Aas'; zope-perl@zope.org
> Subject: RE: [Zope-Perl] Python void context
>
>
> > Is there a way for python functions to find out if they are
> called in
> > void context (i.e. that the caller does not care about a
> > return value)?
>
> AFAIK, no. The return value is just tossed. Python functions know
> little about their callers in general...
>
>
> _______________________________________________
> Zope-perl maillist - Zope-perl@zope.org
> http://lists.zope.org/mailman/listinfo/zope-perl
>