On 15Nov2022 00:45, avi.e.gr...@gmail.com <avi.e.gr...@gmail.com> wrote:
What would be the meaning of an ordering relation determining what is MORE VALID?

Are you asking what criterion would rate:

    clearx = x.clear

as "more" valid than:

    x.clear

on its own?

I don't want to speak for the OP, but I'd think the OP's issue is that the bare `x.clear` is evaluated but not stored in a variable. As a metric, we might gather various descriptive statements we could make about these statements. They'd perhaps include "is legal Python code", "is pretty simple". The former line could include "saves the expression value in a variable for later use" and the latter could not. That's a comparison test you could use for ordering.

My own opinion is that a bare:

    x.clear

is legal and valid for all the example use cases already mentioned, but an entirely valid target for complaint by a linter, whose task is to point out dodgy looking stuff for review by the author.

Cheers,
Cameron Simpson <c...@cskk.id.au>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to