simplegeo / python-simplegeo

A client interface for SimpleGeo's API.
http://simplegeo.com
104 stars 18 forks source link

No pyutil #16

Closed ieure closed 13 years ago

ieure commented 13 years ago

Break the dependency on pyutil, which unnecessarily pulls in all of Twisted.

This changes the semantics of the library somewhat, as different exceptions are raised in some places. Notably, where pyutil's _assert or precondition were used, a ValueError is (usually) raised, instead of AssertionError. Additionally, _assert_valid_lat & _assert_valid_lon raise ValueError instead of TypeError.

While my changes reflect the correct exceptions to raise, they may cause some issues with BC.

Ben and I spoke about this a couple days ago, and we're okay with pushing it, then rolling out a more complex fix (creating new exception types which extend both the old (wrong) exception and the new (correct) one) if customers complain.

aguynamedben commented 13 years ago

Looks good to me. Didn't know about functools' partial, pretty cool. Merging.