GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • [ date ]
  • [ thread ]
  • [ subject ]
  • [ author ]

This view

  • Original page
  • New address

GeezerVison is showing mail.python.org — [Python-Dev] What's the status of PEP 505: None-aware operators?

[Python-Dev] What's the status of PEP 505: None-aware operators?

MRAB python at mrabarnett.plus.com
Fri Dec 1 16:00:35 EST 2017

  • Previous message (by thread): [Python-Dev] What's the status of PEP 505: None-aware operators?
  • Next message (by thread): [Python-Dev] What's the status of PEP 505: None-aware operators?
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

On 2017-12-01 13:24, Random832 wrote:
> On Fri, Dec 1, 2017, at 05:31, Steven D'Aprano wrote:
>> I'm more confused than ever. You seem to be arguing that Python 
>> functions CAN short-circuit their arguments and avoid evaluating them. 
>> Is that the case?
> 
>> If this is merely about when the name "function" is looked up, then I 
>> don't see why that's relevant to the PEP.
>> 
>> What am I missing?
> 
> You're completely missing the context of the discussion, which was the
> supposed reason that a *new* function call operator, with the proposed
> syntax function?(args), that would short-circuit (based on the
> 'function' being None) could not be implemented. The whole thing doesn't
> make sense to me anyway, since a new operator could have its own
> sequence different from the existing one if necessary.
> 
The code:

     function?(args)

would be equivalent to:

     None if function is None else function(args)

where 'function' would be evaluated once.

If function is None, the arguments would not be evaluated.

  • Previous message (by thread): [Python-Dev] What's the status of PEP 505: None-aware operators?
  • Next message (by thread): [Python-Dev] What's the status of PEP 505: None-aware operators?
  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

More information about the Python-Dev mailing list
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.