[issue24379] Add operator.subscript as a convenience for creating slices

2018-07-19 Thread STINNER Victor
STINNER Victor added the comment: > Raymond, Tal and Guido -- do any of you work routinely with multi-dimensional > arrays? Hi Stephan Hoyer, IMHO a *closed* issue is not the most appropriate place to request Guido to change his mind. You may get more traction on python-ideas where you may

[issue24379] Add operator.subscript as a convenience for creating slices

2018-07-19 Thread Stephan Hoyer
Stephan Hoyer added the comment: Raymond, Tal and Guido -- do any of you work routinely with multi-dimensional arrays? In my experience as someone who uses Python everyday for numerical computing (and has been doing so for many years), the need for an operator like this comes up with some

[issue24379] Add operator.subscript as a convenience for creating slices

2018-06-15 Thread Raymond Hettinger
Change by Raymond Hettinger : -- resolution: -> rejected stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2018-06-15 Thread Guido van Rossum
Guido van Rossum added the comment: Let's close it. Just because someone spent a lot of effort on a patch we don't have to accept it. -- ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2018-06-14 Thread Tal Einat
Tal Einat added the comment: So 3.8 then, or should this be closed? FWIW I'm -1. IMO this should be a code recipe somewhere, no need for it to be in the stdlib. -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2017-01-23 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Guido van Rossum
Guido van Rossum added the comment: Actually I'm with Raymond -- I'm also not sure or mildly against (-0). Given how easy it is to do without and how cumbersome using the operator module is I don't see a great benefit. (IMO the operator module should be the measure of *last* resort -- it is not

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Maybe then it makes sense to apply this to 3.7? It looks like most people are in favour of this (also on python-ideas), only Raymond is not sure/mildly against. -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ned Deily
Ned Deily added the comment: I don't think this is appropriate for 3.6 now. We're a little more than 4 weeks from the final release - way past the feature code cut-off - and, from the comments here, there is no longer a total consensus that this feature should go back in at all after being

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: operator_subscript_norefleak_v2.patch LGTM. Waiting for Ned's decision about 3.6. -- assignee: -> ned.deily priority: normal -> release blocker stage: patch review -> commit review versions: +Python 3.6 ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Serhiy, thank you for review! Here is a corrected patch. -- Added file: http://bugs.python.org/file45473/operator_subscript_norefleak_v2.patch ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: The patch is small and it was initially applied before 3.6b1, I think we should ask Ned (added to nosy) if this is OK to apply the fixed version? -- nosy: +ned.deily ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Guido van Rossum
Guido van Rossum added the comment: So we now have the refleak fixed. Can we apply the patch? Or is it too late for 3.6? -- nosy: +gvanrossum ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-13 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Here is a new patch that does not cause refleaks, I just replaced empty __slots__ with a __setattr__: it looks like __slots__ are not needed here to save memory (there is only a singleton instance), they were used just to create an immutable object.

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Nov 12, 2016 at 08:23:45AM +, Raymond Hettinger wrote: > I can't even dream up any scenarios where > ``operator.subscript[3:7:2]`` would be better than > ``slice(3, 7, 2)``. For that specific example, I completely agree. But I think that in

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-12 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: I think it would be more useful for multidimensional slicing: >>> subscript[::-1, ..., ::-1] (slice(None, None, -1), Ellipsis, slice(None, None, -1)) -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-12 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: When I first looked at this a year ago, I thought it seemed like a reasonable idea and might be useful. Since that time, I've haven't encountered any situations whether this would have improved my or someone else's code. And now, I can't even dream up

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Josh Rosenberg
Josh Rosenberg added the comment: #28651 opened for the general problem with empty __slots__ and gc failures. -- ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- Removed message: http://bugs.python.org/msg280422 ___ Python tracker ___

[issue24379] Add operator.subscript as a convenience for creating slices

2016-11-09 Thread Yury Selivanov
Yury Selivanov added the comment: Even more reduced test case: def test_refleak(self): T = typing.TypeVar('T') typing.Generic[T] -- nosy: +yselivanov ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-08-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: > We should open a separate issue for leaks in objects with empty __slots__ The leak should be fixed first rather than introducing stub fields hack. -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-08-15 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: It looks like namedtuple suffers the same issue with empty __slots__: test_collections leaked [0, 0, 2, 0] references, sum=2 -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-08-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Raymond, adding a stub element to __slots__ fixes a leak. Is this enough to push the patch again? We should open a separate issue for leaks in objects with empty __slots__. -- ___ Python tracker

[issue24379] Add operator.subscript as a convenience for creating slices

2016-06-30 Thread Ivan Levkivskyi
Changes by Ivan Levkivskyi : -- nosy: +levkivskyi ___ Python tracker ___ ___

[issue24379] Add operator.subscript as a convenience for creating slices

2015-12-22 Thread Emanuel Barry
Changes by Emanuel Barry : -- nosy: +ebarry stage: resolved -> patch review title: operator.subscript -> Add operator.subscript as a convenience for creating slices ___ Python tracker