On Tue, 15 Nov 2022 09:11:10 +1100, Cameron Simpson <c...@cskk.id.au>
declaimed the following:

>On 13Nov2022 22:23, DFS <nos...@dfs.com> wrote:
>>This is an easy check for the interpreter to make.
>
>It really isn't, given that (a) this isn't known by the interpreter to 
>be a `list` until runtime and (b) that would need embedding special 
>knowledge that looking up an attribute on a `list` has no side effects 
>(versus some other things, where it is not the case).
>

        There is also the minor facet that "x.clear" can be bound to a
different name...

>>> x = [1, 2, 3.145926536, "Pie"]
>>> clearx = x.clear
>>> x
[1, 2, 3.145926536, 'Pie']
>>> clearx()
>>> x
[]
>>> 



-- 
        Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfr...@ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to