[issue31956] Add start and stop parameters to the array.index()

2021-04-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-04-02 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset afd12650580725ac598b2845384771c14c4f952e by Zackery Spytz in 
branch 'master':
bpo-31956: Add start and stop parameters to array.index() (GH-25059)
https://github.com/python/cpython/commit/afd12650580725ac598b2845384771c14c4f952e


--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-30 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-28 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz
nosy_count: 8.0 -> 9.0
pull_requests: +23807
pull_request: https://github.com/python/cpython/pull/25059

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-13 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2021-03-13 Thread Kamil Turek


Change by Kamil Turek :


--
nosy: +kamilturek

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2020-05-23 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

I found this SO about reclaiming an orphaned pull request:
https://stackoverflow.com/a/53383772

But you may still need to open a new PR for it.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2019-09-15 Thread Anders Lorentsen


Anders Lorentsen  added the comment:

I have actually managed to lost my local branch of this fix, though I assume I 
can just start another one, manually copy over the changes, somehow mark this 
current PR as cancelled, aborted, or in my option the best: 
"replaced/superseeded by: [new PR]". In any case, there were discussions that 
seem to be unresolved, allow me to summarize:

* Document that index() raises ValueError when *value* is not found?
> vstinner: We don't do this, remove this addition.
> serhiy: Other index() methods does this.
---> My patch current does this. Who has final saying here?

* 'start' and 'stop' arguments are not keyword arguments, and also not shown in 
the signature as '.. start=0 ..' for this very reason (it may make them look as 
keyword arguments). Also, this lines up with list.index() for consistency. 
Wishes about changing this for all index()-methods has been expressed, but it 
seems to be consensus on doing this in unison for all index()-methods at once, 
in a bigger change... So, what is currently in the PR is good enough for now, 
or?

* Wording in documentation: Clarify that "the returned index is still relative 
to the start of the array, not the searched sub sequence" or not?

* Comment in the code about checking the length of the array on each iteration? 
There were comments about it being "confusing" - and while I agree, the other 
index()-code for lists, does not comment on this. Again I followed the path of 
most consistency, but I did receive comments about this. Yes to descriptive 
comments, or not?



Generally speaking: In the end, all I really did was mimic how list.index() is 
both written and documented, and that's when discussions about issues related 
to that started occurring, and so I now remember that I halted my PR, waiting 
for these issues to be resolved.

--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2019-08-27 Thread Anders Lorentsen


Anders Lorentsen  added the comment:

As far as I can recall, the patch is generally speaking good to go. A number of 
discussions arose on various details, however. In any event, I'll take a look 
at it during the next few days.

--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2019-08-24 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

There is a pending PR here : https://github.com/python/cpython/pull/4435 by 
phaqui. @phaqui do you want to finish your PR ?

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2018-11-29 Thread Ryan G.


Ryan G.  added the comment:

This functionality is useful to me. Is this issue still alive? If not, how can 
I help?

--
nosy: +Ryan G.

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-16 Thread Roundup Robot

Change by Roundup Robot :


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

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread Anders Lorentsen

Anders Lorentsen  added the comment:

Writing my tests, I originally looked at Lib/test/seq_tests.py. One test case 
uses indexes that are (+-)4*sys.maxsize. This does not fit in Py_ssize_t, and 
so these tests cause my array implementation to raise an overflow exception.

A solution is of course to have the function take general objects instead, and 
then truncate them down to a number that can fit in Py_ssize_t if it's too 
negative or positive).

But I concur. It seems more reasonable to stay consistent with the rest of the 
module, too.

I'll look over the test code to make sure I test for every given scenario (or 
as many as I can think of), and prepare a PR for this, then :)

--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-13 Thread STINNER Victor

STINNER Victor  added the comment:

Anders Lorentsen: Py_ssize_t is the correct type for an index in the C 
language. It's not technically possible to create an array object larger than 
PY_SSIZE_T_MAX items :-)

Serhiy> Just take list.index as an example.

I concur with Serhiy :-)

--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Just take list.index as an example.

--
components: +Extension Modules -Library (Lib)
nosy: +serhiy.storchaka
type:  -> enhancement
versions: +Python 3.7 -Python 3.8

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-12 Thread Anders Lorentsen

Anders Lorentsen  added the comment:

I decided to work on this, and I would like some review, as this would be my 
second contribution to cpython. Also, a general question:

As I defined the start and end arguments Py_ssize_t, bigger indexes (more 
negative or more positive) than what can fit in Py_ssize_t will trigger an 
overflow error. This should be OK, though, as other functions with index 
arguments has them as Py_ssize_t - and getarrayitem() itself accepts a 
Py_ssize_t. Or?

--
nosy: +Phaqui
Added file: https://bugs.python.org/file47261/WIP-issue-31956

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-07 Thread Николай Спахиев

Николай Спахиев  added the comment:

I plan to work on a patch.

--

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-06 Thread STINNER Victor

STINNER Victor  added the comment:

Николай Спахиев: Are you only asking for the feature, or are you interested to 
work on a concrete patch?

--
nosy: +haypo

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-06 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

+1

--
nosy: +rhettinger

___
Python tracker 

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



[issue31956] Add start and stop parameters to the array.index()

2017-11-06 Thread Николай Спахиев

New submission from Николай Спахиев :

Sequence protocol specifies 2 optional argument for index method:
seq.index(value, [start, [stop]])

array.index(value) needs start and stop arguments too.

--
components: Library (Lib)
messages: 305629
nosy: Николай Спахиев
priority: normal
severity: normal
status: open
title: Add start and stop parameters to the array.index()
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