https://github.com/osteele/bootle
“Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.” — Stan Kelly-Bootle
https://github.com/osteele/bootle
humor python python-package
Last synced: 8 months ago
JSON representation
“Should array indices start at 0 or 1? My compromise of 0.5 was rejected without, I thought, proper consideration.” — Stan Kelly-Bootle
- Host: GitHub
- URL: https://github.com/osteele/bootle
- Owner: osteele
- License: wtfpl
- Created: 2018-07-23T15:38:18.000Z (almost 8 years ago)
- Default Branch: main
- Last Pushed: 2022-09-04T16:00:04.000Z (almost 4 years ago)
- Last Synced: 2025-02-06T17:13:46.678Z (over 1 year ago)
- Topics: humor, python, python-package
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bootle: Half-Index Lists for Python
“Should array indices start at 0 or 1? My compromise of 0.5 was rejected
without, I thought, proper consideration.” — Stan Kelly-Bootle
## Installation
```bash
pip3 install bootle
```
## Usage
```python
from bootle import List
xs = List([1, 2, 3])
assert xs[0.5] == 1
assert xs[:1.5] == [1]
xs[1.5] == 2
assert xs.index(2) == 1.5
```
## References
* ["Why numbering should start at zero"](https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html), Edsger W. Dijkstra, 1982
* [Why Numbering Should Start At Zero](http://wiki.c2.com/?WhyNumberingShouldStartAtZero), WikiWikiWeb
* [Why Numbering Should Start At One](http://wiki.c2.com/?WhyNumberingShouldStartAtOne), WikiWikiWeb
* [Zero-based numbering](https://en.wikipedia.org/wiki/Zero-based_numbering), Wikipedia
## License
[WTFPL](http://www.wtfpl.net)