"always passes by reference"
Ulrich Schreiner
ulrich.schreiner at innuendo.de
Sat Jul 29 05:05:33 EDT 2000
More information about the Python-list mailing list
Sat Jul 29 05:05:33 EDT 2000
- Previous message (by thread): "always passes by reference"
- Next message (by thread): "always passes by reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
it is all so easy, so why this big discussion? you have ONE and exactly ONE object identity, but you can have multiple references to this identity. in your program you always work with references. if there is no reference your object (the identity) will be GC'd. if your object is immuatable you do not have a chance to change its value, but this is a completely different discussion. how do you call this python style of argument passing? i really don't care. but i find it normal and i do not have any problems with it, although i'm relatively new to python (half a year). the people having problems with this sort of "passing references to perhaps immutable object identities by value" have this problems with any language. i saw really terrible java code from so called "java experts" (sun employees!!!) and these guys have a big problem with their understandig of java's argument passing style. but they don't know this ... ;-) it is really always the same. and it is really very very very simple :-)) "(Greg Weeks)" wrote: > PS to all: Once you distinguish between a word and a writing of a word, the > remaining question is whether you prefer to define an "object" as 1) a > region of memory or 2) an address. #2 may grate on your intuition, but > otherwise it simplifies discussions of what is happening. > > You might say that I (and others!) simply use the term "object" when other > people say "reference". That is almost true. But the people who like the > term "reference" also say that there can be several references to a single > object. This is confused. If an object is a region of memory, it has only > one address. So if there are multiple references, then a "reference" is a > *writing* of an address. I find it confusing to have an expression for a > writing of a word but not for the word itself. </usc>
- Previous message (by thread): "always passes by reference"
- Next message (by thread): "always passes by reference"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list