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
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
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
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,
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
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
> 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
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
>
> 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
> 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
bump :)
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
>
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
22 matches
Mail list logo