Which class method is being called when we declare below expression?

Ben Finney ben+python at benfinney.id.au
Fri Sep 28 23:08:58 EDT 2018


Ben Finney <ben+python at benfinney.id.au> writes:

> Ajay Patel <ajay.patel305 at gmail.com> writes:
>
> > L = [1,2,3]
>
> That's not an expression; it is an assignment statement.
>
> The right-hand side is an expression. […] in this case, [the object] a new
> instance of 'list' […] is the result of evaluating the right-hand side
> of the expression.

I goofed there. That should end with "[…] evaluating the expression on
the right-hand side".

> The statement then assigns the reference 'L' to that object.

-- 
 \           “We have clumsy, sputtering, inefficient brains…. It is a |
  `\     *struggle* to be rational and objective, and failures are not |
_o__) evidence for an alternative reality.” —Paul Z. Myers, 2010-10-14 |
Ben Finney




More information about the Python-list mailing list