On Jul 7, 7:09 pm, Jeff <[EMAIL PROTECTED]> wrote:
> When you call c3.createJoe(c1.fred), you are passing a copy of the
> value stored in c1.fred to your function. Python passes function
> parameters by value.
No, python doesn't pass variable either by value or by reference. The
behavior in pytho
Jeff wrote:
When you call c3.createJoe(c1.fred), you are passing a copy of the
value stored in c1.fred to your function. Python passes function
parameters by value.
These statements are both wrong. Function argument objects or objects
derived therefrom are bound to function parameter names
On Jul 7, 5:07 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Mon, 7 Jul 2008 05:41:22 -0700 (PDT), mcl <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
> > My use of classes is because I want two classes one for global
> > variables and one for global functions.
>
>
Jerry Hill wrote:
> On Mon, Jul 7, 2008 at 7:30 AM, mcl <[EMAIL PROTECTED]> wrote:
>> I did not think you had to make the distinction between 'byvar' and
>> 'byref' as in Basic.
>
> Python does not use "call by value" or "call by reference" semantics.
> Instead, python's model is "call by object".
On Mon, 7 Jul 2008 05:41:22 -0700 (PDT), mcl <[EMAIL PROTECTED]> wrote:
[snip]
> My use of classes is because I want two classes one for global
> variables and one for global functions.
One of the many lovely things about programming in the
Python style is that very few things need to be global.
On Mon, Jul 7, 2008 at 7:30 AM, mcl <[EMAIL PROTECTED]> wrote:
> I did not think you had to make the distinction between 'byvar' and
> 'byref' as in Basic.
Python does not use "call by value" or "call by reference" semantics.
Instead, python's model is "call by object". See this writeup for
some
mcl wrote:
> On 7 Jul, 13:09, Jeff <[EMAIL PROTECTED]> wrote:
>> When you call c3.createJoe(c1.fred), you are passing a copy of the
>> value stored in c1.fred to your function. Python passes function
>> parameters by value. The function will not destructively modify its
>> arguments; you must exp
On 7 Jul, 13:09, Jeff <[EMAIL PROTECTED]> wrote:
> When you call c3.createJoe(c1.fred), you are passing a copy of the
> value stored in c1.fred to your function. Python passes function
> parameters by value. The function will not destructively modify its
> arguments; you must expliticly state you
When you call c3.createJoe(c1.fred), you are passing a copy of the
value stored in c1.fred to your function. Python passes function
parameters by value. The function will not destructively modify its
arguments; you must expliticly state your intention to modify an
object:
class one():
fred =
mcl wrote:
> Why can I not the change the value of a variable in another class,
> when I have passed it via a parameter list.
>
> I am sure I am being stupid, but I thought passed objects were Read/
> Write
In Python, there are names which are bound to objects. Doing "foo = bar"
and then "foo = s
Why can I not the change the value of a variable in another class,
when I have passed it via a parameter list.
I am sure I am being stupid, but I thought passed objects were Read/
Write
eg
#!/usr/bin/python
class one(): #my Global Var
11 matches
Mail list logo