[issue24379] operator.subscript

2015-12-22 Thread Joe Jevnik

Joe Jevnik added the comment:

> and the latter might give the impression it was some sort of special 
> method/attribute when it was not.

Wouldn't adding this be special because it is specifically reserved by CPython 
as an implementation detail?

Also, would adding this name (__stub or __stub__) be sufficient to get this 
patch merged again. I would not mind investigating the gc_head issue after but 
I view that as a separate issue which is only exercised by this patch.

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-11-03 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Martin: I think the primary reason I suggested an empty __slots__ was to avoid 
people doing dumb stuff like attaching attributes to the singleton, and then 
getting annoyed if support for them was removed in some future release (e.g. if 
this ever moved to C for whatever reason), or expecting them to survive 
pickling, what have you. The memory savings (if any) would be negligible, it 
was just to avoid future compatibility concerns.

Serhiy: If we add a stub slot, presumably it should be __stub, not __stub__, 
the former getting the private member name mangling protection while the latter 
would not (and the latter might give the impression it was some sort of special 
method/attribute when it was not).

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-11-02 Thread Martin Panter

Martin Panter added the comment:

On the mailing list, Antoine also suggested removing __slots__ completely as 
another workaround. I agree that it doesn’t seem important for a singleton, 
though in the review comments a couple people seemed to want __slots__.

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-11-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The are is a reference loop:

global instance -> type -> method -> module globals -> global instance

Since an instance doesn't have GC head if __slots__ is empty, the loop can't be 
broken.

A workaround is to add a stub element to __slots__:

__slots__ = ('__stub__',)

But operator.subscript is not the only class that causes a reference leak. Any 
class with empty __slots__ can create a loop and cause a leak.

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-11-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 83fa2e9b0038 by Raymond Hettinger in branch 'default':
Issue #24379:  Revert the operator.subscript patch (dccc4e63aef5) pending 
resolution of the related refcnt leak.
https://hg.python.org/cpython/rev/83fa2e9b0038

--

___
Python tracker 

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



[issue24379] operator.subscript

2015-11-01 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: rhettinger -> 
priority: high -> normal

___
Python tracker 

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



[issue24379] operator.subscript

2015-10-21 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> high

___
Python tracker 

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



[issue24379] operator.subscript

2015-10-21 Thread Raymond Hettinger

Raymond Hettinger added the comment:

This is causing a reference leak problem:  
https://mail.python.org/pipermail/python-dev/2015-October/141993.html

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue24379] operator.subscript

2015-08-16 Thread Josh Rosenberg

Josh Rosenberg added the comment:

So this has sign off on Python ideas, and it's not fundamentally changing the 
language (it's implemented in pure Python after all), it's passed a dozen code 
reviews. Can someone with commit privileges just finish this off please?

--

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



[issue24379] operator.subscript

2015-08-16 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue24379] operator.subscript

2015-08-16 Thread Joe Jevnik

Joe Jevnik added the comment:

Sorry about the ideas thread. Thank you for merging this!

--

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



[issue24379] operator.subscript

2015-08-16 Thread R. David Murray

R. David Murray added the comment:

For future reference can you post a link to the python-ideas thread in which 
the signoff occurred?

--
nosy: +r.david.murray
stage: patch review - commit review

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



[issue24379] operator.subscript

2015-08-16 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
resolution:  - fixed
stage: commit review - resolved
status: open - closed

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



[issue24379] operator.subscript

2015-08-16 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The old python ideas discussion stops way short of a sign-off but I'll go 
ahead an apply the patch.  If someone really hates it, they have a year and 
half to persuade someone to rip it out ;-)  

https://mail.python.org/pipermail/python-ideas/2015-June/034086.html

--

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



[issue24379] operator.subscript

2015-08-16 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dccc4e63aef5 by Raymond Hettinger in branch 'default':
Issue #24379: Add operator.subscript() as a convenience for building slices.
https://hg.python.org/cpython/rev/dccc4e63aef5

--
nosy: +python-dev

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



[issue24379] operator.subscript

2015-07-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

 (This should probably be discussed on the Python Ideas
 mailing list...)

Overall, I really the idea and think it should go forward, but it does warrant 
being kicked around on python-ideas and Guido should have an opportunity to 
weigh in (because it changes the look and feel of the API for a builtin 
function).

--

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



[issue24379] operator.subscript

2015-07-28 Thread Joe Jevnik

Joe Jevnik added the comment:

I posted this to python Ideas on June 10th of this year. That is where we 
decided to rename it from `slice.literal` to `operator.subscript`.

--

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



[issue24379] operator.subscript

2015-07-24 Thread Joe Jevnik

Joe Jevnik added the comment:

Any more comments?

--

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



[issue24379] operator.subscript

2015-07-14 Thread Joe Jevnik

Joe Jevnik added the comment:

I updated the docstring

--

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



[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik

Joe Jevnik added the comment:

updating to address the docs and order of assertions

--
Added file: http://bugs.python.org/file39904/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-07-12 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm with Martin about tests. Only one assertion per special case is needed, no 
need to write exponential number of combinations.

--

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




[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik

Joe Jevnik added the comment:

is it normal to get a lot of 500s when using the review system?

--
Added file: http://bugs.python.org/file39906/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik

Changes by Joe Jevnik j...@quantopian.com:


Added file: http://bugs.python.org/file39907/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-07-12 Thread Joe Jevnik

Changes by Joe Jevnik j...@quantopian.com:


Added file: http://bugs.python.org/file39913/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-07-11 Thread Martin Panter

Martin Panter added the comment:

Joe: Have you seen the comments on the code review? See the Review link at the 
top of the bug thread, or maybe check your spam.

--
nosy: +vadmium
stage:  - patch review

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



[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik

Joe Jevnik added the comment:

Ah, I hadn't seen that, I will address those now, sorry about that.

--

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



[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik

Joe Jevnik added the comment:

updating with the slots change

This also adds a ton of test cases

--
Added file: http://bugs.python.org/file39902/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik

Joe Jevnik added the comment:

ping: is there anything blocking this?

--

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



[issue24379] operator.subscript

2015-07-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The implementation itself LGTM (nice use of decorator). New feature should be 
documented. Needed changes in Doc/library/operator.rst and Doc/whatsnew/3.6.rst 
and the docstring for the subscript class. 'subscript' should be added to 
__all__.

--

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



[issue24379] operator.subscript

2015-06-23 Thread Joe Jevnik

Joe Jevnik added the comment:

I removed the C implementation.

--
Added file: http://bugs.python.org/file39792/operator_subscript_pyonly.patch

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



[issue24379] operator.subscript

2015-06-22 Thread Joe Jevnik

Joe Jevnik added the comment:

Based on some discussion on python-ideas, this is being renamed to 
operator.subscript. Here is the patch that makes the correct the changes to 
move this object into the operator module.

--
components: +Extension Modules -Interpreter Core
title: slice.literal notation - operator.subscript
Added file: http://bugs.python.org/file39775/operator_subscript.patch

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



[issue24379] operator.subscript

2015-06-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is C implementation needed?

--

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



[issue24379] operator.subscript

2015-06-22 Thread Josh Rosenberg

Changes by Josh Rosenberg shadowranger+pyt...@gmail.com:


--
nosy: +josh.r

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



[issue24379] operator.subscript

2015-06-22 Thread Joe Jevnik

Joe Jevnik added the comment:

I just moved it over since I implemented it for slice originally, I can drop 
the C implementation.

--

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