>>> def leap(x, d=400):
	if x < 0:
		return leap(-x, d)

	if x == 0:
		if d == 400:
			return True
		if d == 100:
			return False
		if d == 4:
			return True

	if x < d:
		if d == 400:
			return leap(x, 100)
		if d == 100:
			return leap(x, 4)
		if d == 4:
			return False

	return leap(x - d, d)

>>> leap(1900)
False
>>> leap(2000)
True
>>> leap(2008)
True
>>> leap(2100)
False