yougov / fuzzy

MIT License
50 stars 11 forks source link

Soundex method clobbers namespace #3

Open jaraco opened 12 years ago

jaraco commented 12 years ago

Originally reported by: Anonymous


Computing the Soundex for a string that matches an imported module seems to clobber that module's namespace. See below from my interactive shell:

#!python

>>> import datetime, fuzzy
>>> soundex = fuzzy.Soundex(4)
>>> datetime
<module 'datetime' from '/usr/lib/python2.6/lib-dynload/datetime.so'>
>>> soundex('datetime')
'D350'
>>> datetime
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'datetime' is not defined