Repository navigation
Conversation
|
Can you add a test? |
|
I'm editing it, this may take a while, please excuse me. |
|
For the two solutions mentioned by I chose the latter because almost all test functions in the test assume that when hi is a negative number, there will be a default processing. But I don't want to refactor this test on a large scale, so I chose the latter, and in the test, it mainly judges that when its hi is a negative number, it can automatically handle it. Is negative and it is not negative 1, it can be negative infinity. |
|
I see a modification to If someone somehow winds up running the python code in Lib/bisect.py, would it still have the bug? |
|
Maybe not. You can read the test I added.It described that under normal use, when the hi parameter is negative, there will be no abnormality. I'm not sure if this is what you expected. Edit In fact, the c file I changed corresponds to the implementation in python. Generally, python calls the c function. |
picnixz
left a comment
There was a problem hiding this comment.
In fact, the c file I changed corresponds to the implementation in python. Generally, python calls the c function.
This is incorrect. The C implementation is used if it is available. I think we should first discuss more on whether negative indices should be supported at all.
Currently hi == -1 means for the C implementation "not given" but we should decide first whether hi < 0 means "count from the end". And we should synchronize both the Python and the C implementation so that they consider hi < 0 the same way.
|
Oh, forgive me, the description seems to be a little failed. I want to say c implementation, but what it mentions is py implementation. I will continue to change it later. |
|
FWIW, the |
|
Therefore, there are two points of focus on the current discussion.
|
|
I will close this RP, maybe we need to wait until that unified proposal before moving forward, then we can reopen it. Thank you for your attention to this. |
Uh oh!
There was an error while loading. Please reload this page.