Is 'everything' a refrence or isn't it?

bonono at gmail.com bonono at gmail.com
Fri Jan 6 05:49:50 EST 2006


Steven D'Aprano wrote:
> On Fri, 06 Jan 2006 02:19:29 -0800, bonono wrote:
>
> >
> > Steven D'Aprano wrote:
> >> I'll tell you what I say: Python passes objects to functions or
> >> assignments.
> >>
> > Which in C sense, is a reference(or pointer) to some opaque "table"
> > maintain by the system, identified by id().
>
> And that C sense is precisely why people try using C idioms in Python and
> then are surprised that they don't behave as they would in C.
>
> So how about we all agree to stop implying that Python behaves like C, and
> try to teach people that Python behaves like Python?
>
No one implies Python behaves like C but just trying to explain as
close as possible to people speaking that language.

"passed by object" can just as easilly be interpreted as "the function
received a seperate copy", with the caller's copy untouched.




More information about the Python-list mailing list