[issue33200] Optimize the empty set "literal"

2018-04-09 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Closed due to the lack of practical applications. Can be reopened if this idiom 
become popular.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-02 Thread Josh Rosenberg

Josh Rosenberg  added the comment:

I may have immediately latched onto this, dubbing it the "one-eyed monkey 
operator", the moment the generalized unpacking released.

I always hated the lack of an empty set literal, and enjoyed having this exist 
just to fill that asymmetry with the other built-in collection types (that 
said, I never use it in production code, nor teach it in classes I run).

--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-01 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Does anyone seriously write "{*()}" instead of "set()"?

It doesn't seem to be laughing to me.

--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-01 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Don't know. :-)

Consider this as a 1st April egg.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-01 Thread Mark Dickinson

Mark Dickinson  added the comment:

Does anyone seriously write "{*()}" instead of "set()"?

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-01 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +6043
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33200] Optimize the empty set "literal"

2018-04-01 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The following PR optimizes bytecode for the empty set "literal": {*()}.

Currently it is compiled to

LOAD_CONST   0 (())
BUILD_SET_UNPACK 1

It will optimized to

BUILD_SET0

$ ./python -m perf timeit --duplicate 1000 '{*()}'

Unpatched:  Mean +- std dev: 68.6 ns +- 1.1 ns
Patched:Mean +- std dev: 31.8 ns +- 2.8 ns

--
components: Interpreter Core
messages: 314769
nosy: benjamin.peterson, brett.cannon, ncoghlan, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Optimize the empty set "literal"
type: performance
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com