"Paul McGuire" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I have some places in pyparsing where I've found that the most
> straightforward way to adjust an instance's behavior is to change its
> class.
> I do this by assigning to se
Heiko Wundram <[EMAIL PROTECTED]> wrote:
> bruno at modulix wrote:
> > Paul McGuire wrote:
> >> or am I taking advantage of a fortuitous accident, which may get
> >> undone at a future time?
> >
> > It's certainly not a fortuitous accident.
>
> And even the (printed) cookbook has examples which
bruno at modulix wrote:
> Paul McGuire wrote:
>> or am I taking advantage of a fortuitous accident, which may get
>> undone at a future time?
>
> It's certainly not a fortuitous accident.
And even the (printed) cookbook has examples which assign to
self.__class__... I guess this means this featu
ython is to :
>(snip) assigning to self.__class__, (snip)
!-)
>
> Any comments on this practice?
It can be very confusing for newbies and peoples having no experience
with *dynamic* languages, and I guess control-freaks and
static-typing-addicts would runaway screaming. But I like it
I have some places in pyparsing where I've found that the most
straightforward way to adjust an instance's behavior is to change its class.
I do this by assigning to self.__class__, and things all work fine.
(Converting to use of __new__ is not an option - in one case, the change is