Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplemented .pop() method for list #126
Conversation
|
@xarus01 CI is failed. Please take a look |
|
Here is the failure. This is trying to run the tests under python3.4.
(there was more stuff I've snipped out the error which seems to be python trying to report errors via apport and failing |
| assert a.pop() == 1 | ||
| assert a.pop(2) == 4 |
This comment has been minimized.
This comment has been minimized.
tim-st
Dec 1, 2019
•
Contributor
The pop operation removes and returns from the back, I think your idea was removing from the front.
It would be good if you create a new list for each test and compare your test against a list like assert a.pop(-1) == element; assert a = [...], that makes it more clear here.
Additionally the following tests would be good:
- negative index
- index out of range for non-empty list
- parameter of wrong type (non-int)

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

xarus01 commentedNov 6, 2019
•
edited by sbinet
Fixes #95.