fuzzyattr matches the closest attribute name in python so you can make unlimited free typos.
Decorate any class.
from fuzzyattr import fuzzyattr
@fuzzyattr
class Human:
def __init__(self, name):
self.name = name
def eat(self, food):
return f'{self.name} ate {food}'Or wrap the class.
Human = fuzzyattr(Human)Now you can make typos.
someone = Human('Someone')
someone.ate('poop')ate doesn't exist. fuzzyattr matches eat. It logs a warning when this happens.
Fix non-PEP8 code written by other morons. Make python standard library more pythonic.
BetterTestCase = fuzzyattr(unittest.TestCase)
class PythonicTest(BetterTestCase):
def test_thing(self):
self.assert_equal(True, False)
# much better than assertEqualpip install fuzzyattr