This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
transitivity.py | |
Author: Naftali Harris | |
Run this in a clean virtualenv to only find intransitive triples in the stdlib. | |
""" | |
import pkgutil | |
import inspect | |
import collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# An enhancement to the "python" executable that automatically launches you into the python debugger on error. | |
# | |
# Use it like you would the "python" executable, for example: | |
# $ trypy somefile.py | |
# or | |
# $ trypy somefile.py arg1 arg2 | |
# | |
# EXAMPLE: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Modified slightly from https://github.com/naftaliharris/lazysort */ | |
int partition(LSObject *ls, int left, int right) { | |
PyObject **ob_item = ls->xs->ob_item; /* The array to be sorted */ | |
int piv_idx = pick_pivot(ls, left, right); | |
PyObject *pivot = ob_item[piv_idx]; | |
SWAP(left, piv_idx); | |
int last_less = left; | |
/* Invariant: last_less and everything to its left is less than |