Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soundex breaks deepcopy somehow #4

Open
jaraco opened this issue May 1, 2012 · 1 comment
Open

soundex breaks deepcopy somehow #4

jaraco opened this issue May 1, 2012 · 1 comment

Comments

@jaraco
Copy link
Contributor

jaraco commented May 1, 2012

Originally reported by: Anonymous


running Soundex on a string changes the original string to uppercase.
That's all well and good, but interestingly, it also changes a deep copy of the original string! that seems pretty wrong...

#!python

>>>x = "blabla"
>>>y = copy.deepcopy(x)
>>>sndex = fuzzy.soundex(32)
>>>print sndex(x)
B4140000000000000000000000000000
>>>print x
BLABLA
>>>print y
BLABLA
>>>#running soundex on x changes deep copy y!

@jaraco
Copy link
Contributor Author

jaraco commented Jul 2, 2014

Original comment by Rohan Anand (Bitbucket: rohan_anand, GitHub: Unknown):


This fork has got it fixed : https://bitbucket.org/dhellmann/fuzzy
Basically deepcopy doesn't work because strings are immutable in python but since the library internally makes a C call, it gets modified in place by C which should have not happened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant