is implemented with id ?

Chris Angelico rosuav at gmail.com
Thu Sep 6 05:07:31 EDT 2012


On Thu, Sep 6, 2012 at 6:26 PM, Ramchandra Apte <maniandram01 at gmail.com> wrote:
> the is statement could be made into a function

It's not a statement, it's an operator; and functions have far more
overhead than direct operators. There's little benefit in making 'is'
into a function, and high cost; unlike 'print', whose cost is
dominated by the cost of producing output to a console or similar
device, 'is' would be dominated by the cost of name lookups and
function call overhead.

ChrisA



More information about the Python-list mailing list