Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74342

Re: context manager based alternative to Re: Proposal: === and !===

References <mailman.11744.1405038048.18130.python-list@python.org> <roy-B07C5D.21172810072014@news.panix.com>
Date 2014-07-11 14:37 +1000
Subject Re: context manager based alternative to Re: Proposal: === and !===
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11750.1405053430.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jul 11, 2014 at 11:17 AM, Roy Smith <roy@panix.com> wrote:
> In article <mailman.11744.1405038048.18130.python-list@python.org>,
>  Cameron Simpson <cs@zip.com.au> wrote:
>
>> Q: How many user support people does it take to change a light bulb?
>> A: We have an exact copy of the light bulb here and it seems to be
>>     working fine.  Can you tell me what kind of system you have?
>
> So, what are we talking about here?  my_lightbulb == your_lightbulb, or
> my_lightbulb === your_lightbulb, or my_lightbulb is your_lightbulb?  Or
> just sha1(my_lightbulb) == sha1(your_lightbulb)?

Probably type(my_lightbulb).__name__ == type(your_lightbulb).__name__,
knowing the reliability of support people...

I'm a bit wary of anything that makes a global, even if temporary,
change to comparisons' behaviours. What happens if, deep in a call
tree, something utterly unrelated happens to do a comparison of this
nature? Does C-level code have to check this flag before comparing
nans, or is this applicable only to the Python float objects and only
when compared in Python? Is isnan() still usable? (Consider that x!=x
== math.isnan(x) normally.)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

context manager based alternative to Re: Proposal: === and !=== Cameron Simpson <cs@zip.com.au> - 2014-07-11 10:20 +1000
  Re: context manager based alternative to Re: Proposal: === and !=== Roy Smith <roy@panix.com> - 2014-07-10 21:17 -0400
    Re: context manager based alternative to Re: Proposal: === and !=== Chris Angelico <rosuav@gmail.com> - 2014-07-11 14:37 +1000

csiph-web