Ethan Furman a écrit :
(snip)
The best answer I can give is that you do not want to use 'name' to
reference the object itself, but only for printing/debugging purposes.
Which is what the OP stated !-)
'name' is just a label for your object, and not necessarily the only
label; that particul
josef wrote:
On Aug 27, 1:35 pm, Ethan Furman wrote:
josef wrote:
Thanks to everyone who responded.
I will be going with some sort of a = MyClass(name = 'a') format. It's
the Python way.
For me, it was very hard to accept that EVERYTHING is an object
reference. And that there are no ob
On Aug 27, 1:35 pm, Ethan Furman wrote:
> josef wrote:
> > Thanks to everyone who responded.
>
> > I will be going with some sort of a = MyClass(name = 'a') format. It's
> > the Python way.
>
> > For me, it was very hard to accept that EVERYTHING is an object
> > reference. And that there are no o
josef wrote:
Thanks to everyone who responded.
I will be going with some sort of a = MyClass(name = 'a') format. It's
the Python way.
For me, it was very hard to accept that EVERYTHING is an object
reference. And that there are no object reference names, just string
entries in dictionaries. But
Thanks to everyone who responded.
I will be going with some sort of a = MyClass(name = 'a') format. It's
the Python way.
For me, it was very hard to accept that EVERYTHING is an object
reference. And that there are no object reference names, just string
entries in dictionaries. But I think it all
On Tuesday 25 August 2009 21:32:09 Aahz wrote:
> In article ,
>
> Hendrik van Rooyen wrote:
> >On Friday 21 August 2009 08:07:18 josef wrote:
> >> My main focus of this post is: "How do I find and use object reference
> >> memory locations?"
> >>
> a = [1,2,3,4]
> id(a)
> >
> >8347088
>
In article ,
Hendrik van Rooyen wrote:
>On Friday 21 August 2009 08:07:18 josef wrote:
>>
>> My main focus of this post is: "How do I find and use object reference
>> memory locations?"
>
a = [1,2,3,4]
id(a)
>8347088
Of course, that doesn't actually allow you to do anything...
-
josef a écrit :
(snip)
> I think that something like a = MyClass0(name =
'a', ...) is a bit redundant. Are definitions treated the same way?
How would one print or pass function names?
In Python, classes and functions are objects too. The class and def
statements are mostly syntactic sugar th
josef writes:
> On Aug 21, 4:26 am, Ben Finney wrote:
> > Note that, after that list is created, each item in that list is
> > *also* a reference to the corresponding object. That is, ‘a’ is a
> > reference to an object, and ‘dk[0]’ is a *different* reference to
> > the *same* object. The object
On Aug 21, 12:12 pm, josef wrote:
> > > I need the object reference name (a,b,c,d) from dk to use as input for
> > > a file.
>
> > You'll have to track that yourself.
>
> I'm a bit shocked that there isn't a method for catching object
> reference names. I think that something like a = MyClass0(nam
On Aug 21, 4:26 am, Ben Finney wrote:
> josef writes:
> > To be clear, Python uses a "Pass By Object Reference" model.
>
> Yes. (I'm glad this concept has propagated to newcomers so well :-)
I found one really good discussion on python semantics versus other
languages. It gave me this gem of a q
On Aug 21, 2:07 am, josef wrote:
> To begin, I'm new with python. I've read a few discussions about
> object references and I think I understand them.
>
> To be clear, Python uses a "Pass By Object Reference" model.
> x = 1
> x becomes the object reference, while an object is created with the
> ty
josef writes:
> To be clear, Python uses a "Pass By Object Reference" model.
Yes. (I'm glad this concept has propagated to newcomers so well :-)
> x = 1
> x becomes the object reference
It becomes *a* reference to that object, independent of any other
references to that same object.
> while a
josef a écrit :
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
type 'int', value 1, and identi
josef wrote:
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
type 'int', value 1, and identifie
On Aug 21, 1:34 am, Miles Kaufmann wrote:
> On Aug 20, 2009, at 11:07 PM, josef wrote:
>
> > To begin, I'm new with python. I've read a few discussions about
> > object references and I think I understand them.
>
> > To be clear, Python uses a "Pass By Object Reference" model.
> > x = 1
> > x beco
On Friday 21 August 2009 08:07:18 josef wrote:
> My main focus of this post is: "How do I find and use object reference
> memory locations?"
>>> a = [1,2,3,4]
>>> id(a)
8347088
>>>
- Hendrik
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Aug 20, 2009 at 11:34 PM, Miles Kaufmann wrote:
> On Aug 20, 2009, at 11:07 PM, josef wrote:
>> The following is what I would like to do:
>> I have a list of class instances dk = [ a, b, c, d ], where a, b, c, d
>> is an object reference. Entering dk gives me the object: [MyClass0
>> insta
On Aug 20, 2009, at 11:07 PM, josef wrote:
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
typ
To begin, I'm new with python. I've read a few discussions about
object references and I think I understand them.
To be clear, Python uses a "Pass By Object Reference" model.
x = 1
x becomes the object reference, while an object is created with the
type 'int', value 1, and identifier (id(x)). Doin
20 matches
Mail list logo