Skip to content

Instantly share code, notes, and snippets.

View encolpe's full-sized avatar

Encolpe DEGOUTE encolpe

View GitHub Profile
@encolpe
encolpe / python_wat.py
Created January 5, 2017 08:25
What happen if you're append a list to itself in python?
#!/bin/python
a = [1, 1, 1]
b = a
print(b)
b.append(a)
print(b)
print(b[-1])
print(b[-1][-1])
c = b
### Keybase proof
I hereby claim:
* I am encolpe on github.
* I am encolpe (https://keybase.io/encolpe) on keybase.
* I have a public key ASCcPbfhm3qTVJ4rNOsVswGxPS10VSauslu0kyVdTmDJvgo
To claim this, I am signing this object:
@encolpe
encolpe / paginate.py
Created December 26, 2018 21:10
Pagination tests
import math
TEST_DATA = [
{
'total': 7,
'range': 3,
'orphan': 1,
'have_orphan': True,
'nb_pages': 2,