Ben Finney writes:
> Ajay Patel 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
Ajay Patel writes:
> L = [1,2,3]
That's not an expression; it is an assignment statement.
The right-hand side is an expression. It will (at the top level) create
a list.
To create a new instance of the 'list' type, Python will call the type's
'__new__' method. This is termed the constructor
On Fri, Sep 28, 2018 at 8:52 AM Ajay Patel wrote:
>
> Hello gauys,
>
> Which list class method will call for below codes?
>
> L = [1,2,3]
> And
> L =[]
None. Simple assignment does not call any methods. It just takes the
value on the right hand side and says, hey, "L", you now mean that
thing,
Hello gauys,
Which list class method will call for below codes?
L = [1,2,3]
And
L =[]
Thanks,
Ajay
--
https://mail.python.org/mailman/listinfo/python-list