Re: A class question

2007-10-30 Thread George Sakkis
On Oct 28, 6:01 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > Is there a way I can, for debugging, access the instance variable name from > within a class? Shouldn't this be in a FAQ somewhere? It's the second time (at least!) it comes up this week. George -- http://mail.python.org/mailman/listi

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > > >>>While Java's variable declarations bear a superficial (syntactical) >>>similarity to C, their semantics is in fact equivalent to the >>>object-reference semantics we know in Python. They implicitly refer >>>to ob

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Donn Ingle a écrit : >>vzcbeg vafcrpg >> >>qrs _svaq(senzr, bow): >>sbe anzr, inyhr va senzr.s_ybpnyf.vgrevgrzf(): >>vs inyhr vf bow: >>erghea anzr >>sbe anzr, inyhr va senzr.s_tybonyf.vgrevgrzf(): >>vs inyhr vf bow: >>erghea anzr >>envfr XrlReebe

Re: A class question

2007-10-30 Thread Hrvoje Niksic
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> While Java's variable declarations bear a superficial (syntactical) >> similarity to C, their semantics is in fact equivalent to the >> object-reference semantics we know in Python. They implicitly refer >> to objects allocated on the heap and,

Re: A class question

2007-10-30 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > >>> It seems to me that in recent times more Python beginners come from >>> a Java background than from a C one. >> Java does have "container" variables for primitive types, and even >> for "references", Java's variables

Re: A class question

2007-10-29 Thread Gabriel Genellina
En Tue, 30 Oct 2007 02:51:39 -0300, Donn Ingle <[EMAIL PROTECTED]> escribió: >> While Java's variable declarations bear a superficial (syntactical) >> similarity to C, their semantics is in fact equivalent to the >> object-reference semantics we know in Python. > > I come from Z80A/GWBASIC/VB an

Re: A class question

2007-10-29 Thread Donn Ingle
> While Java's variable declarations bear a superficial (syntactical) > similarity to C, their semantics is in fact equivalent to the > object-reference semantics we know in Python. I come from Z80A/GWBASIC/VB and a little C, I would describe a Python variable as a pointer - in that it contains t

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> It seems to me that in recent times more Python beginners come from >> a Java background than from a C one. > > Java does have "container" variables for primitive types, and even > for "references", Java's variables are more than names - they do >

Re: A class question

2007-10-29 Thread Donn Ingle
> vzcbeg vafcrpg > > qrs _svaq(senzr, bow): > sbe anzr, inyhr va senzr.s_ybpnyf.vgrevgrzf(): > vs inyhr vf bow: > erghea anzr > sbe anzr, inyhr va senzr.s_tybonyf.vgrevgrzf(): > vs inyhr vf bow: > erghea anzr > envfr XrlReebe("Bowrpg abg sbhaq va

Re: A class question

2007-10-29 Thread Donn Ingle
> for humans: Sweet. Thanks, I'll give it a go. It's only for debugging and will make life easier. \d -- http://mail.python.org/mailman/listinfo/python-list

Re: A class question

2007-10-29 Thread Donn Ingle
bump :) -- http://mail.python.org/mailman/listinfo/python-list

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > >> The problem is that your formulation implies (to me at least) that the >> variable is actually a kind of container for the object. > > I really didn't expect it to be read that way, especially since the > sentence cl

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: > The problem is that your formulation implies (to me at least) that the > variable is actually a kind of container for the object. I really didn't expect it to be read that way, especially since the sentence claims that the same instance can reside

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> > writes: > >>> As others have answered, an instance can live in many variables, >> "be bound to many names" would be more accurate IMHO. > > Technically more accurate maybe (but see below), but I was responding > to a beginner's p

Re: A class question

2007-10-29 Thread emorfo
On Oct 29, 12:46 pm, "Martin Marcher" <[EMAIL PROTECTED]> wrote: > 2007/10/29, Hrvoje Niksic <[EMAIL PROTECTED]>: > > > Sbe unpx inyhr, urer vf n cbffvoyr vzcyrzragngvba: > > ... > > was that on purpose? > > martin > > --http://noneisyours.marcher.namehttp://feeds.feedburner.com/NoneIsYours for hu

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Bruno Desthuilliers <[EMAIL PROTECTED]> writes: >> As others have answered, an instance can live in many variables, > > "be bound to many names" would be more accurate IMHO. Technically more accurate maybe (but see below), but I was responding to a beginner's post, so I was striving for ease of u

Re: A class question

2007-10-29 Thread Martin Marcher
2007/10/29, Hrvoje Niksic <[EMAIL PROTECTED]>: > Sbe unpx inyhr, urer vf n cbffvoyr vzcyrzragngvba: > ... was that on purpose? martin -- http://noneisyours.marcher.name http://feeds.feedburner.com/NoneIsYours -- http://mail.python.org/mailman/listinfo/python-list

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Hrvoje Niksic a écrit : > Donn Ingle <[EMAIL PROTECTED]> writes: > >> Is there a way I can, for debugging, access the instance variable name from >> within a class? >> E.g: >> Class X: >> def debug(self): >> print "My instance var is %s" % (some magic Python stuff) > > As others have answered

Re: A class question

2007-10-29 Thread Hrvoje Niksic
Donn Ingle <[EMAIL PROTECTED]> writes: > Is there a way I can, for debugging, access the instance variable name from > within a class? > E.g: > Class X: > def debug(self): > print "My instance var is %s" % (some magic Python stuff) As others have answered, an instance can live in many variabl

Re: A class question

2007-10-29 Thread Carl Banks
On Oct 28, 6:01 am, Donn Ingle <[EMAIL PROTECTED]> wrote: > Hello, > > Is there a way I can, for debugging, access the instance variable name from > within a class? > E.g: > Class X: > def debug(self): > print "My instance var is %s" % (some magic Python stuff) > > So that: > > >>>x = X() > >>>x

Re: A class question

2007-10-29 Thread Bruno Desthuilliers
Donn Ingle a écrit : > Hello, > > Is there a way I can, for debugging, access the instance variable name from > within a class? > E.g: > Class X: > def debug(self): > print "My instance var is %s" % (some magic Python stuff) > > So that: x = X() x.debug() My Instance var is x >

A class question

2007-10-29 Thread Donn Ingle
Hello, Is there a way I can, for debugging, access the instance variable name from within a class? E.g: Class X: def debug(self): print "My instance var is %s" % (some magic Python stuff) So that: >>>x = X() >>>x.debug() >>>My Instance var is x ( Without passing the name in like: x=X(name="x