|
Boost : |
From: Rainer Deyke (root_at_[hidden])
Date: 2001-08-16 20:05:30
----- Original Message -----
From: "Ralf W. Grosse-Kunstleve" <rwgk_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, August 16, 2001 1:33 PM
Subject: [boost] Re: python member function naming problem
> > What's going on with this? Any other name besides 'print' works fine
> > here. Is this because the Order::print method (which I am not
> > exposing to python) is somehow clashing??
>
> "print" is a reserved Python keyword and cannot be used as an identifier
> for function names, including method names.
That's not quite true.
>>> class C: pass
...
>>> c = C()
>>> setattr(c, 'print', 5)
>>> dir(c)
['print']
>>> getattr(c, 'print')
5
>>>
The expression 'c.print' is currently a syntax error, but this is likely to
change in the future.
-- Rainer Deyke (root_at_[hidden]) Shareware computer games - http://rainerdeyke.com "In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk