It achieves NON-1:1 mapping of identifiers within your program
to obfuscated identifiers. For example, not only is
'self' no longer 'self',
but 'self' is generally
replaced by a variety of different gibberish identifiers,
without impairing program functionality.
Names to specially spare from obfuscation
(obfuscator should not need help for most names):
Limits on handling of keyword arguments
If you make a function call with keyword arguments, the keyword argument
names in the function call are presently left unobfuscated.
Why did I do this?
Suppose the keyword arguments are going into a dictionary,
as in this example code from Guido van Rossum's Python Tutorial (Release 2.4.2)
wherein the dictionary is named "keywords" ...
def cheeseshop(kind, *arguments, **keywords):
print "-- Do you have any", kind, '?'
print "-- I'm sorry, we're all out of", kind
for arg in arguments: print arg
print '-'*40
keys = keywords.keys()
keys.sort()
for kw in keys: print kw, ':', keywords[kw]
cheeseshop('Limburger', "It's very runny, sir.",
"It's really very, VERY runny, sir.",
client='John Cleese',
shopkeeper='Michael Palin',
sketch='Cheese Shop Sketch')
which is intended to print:
-- Do you have any Limburger ?
-- I'm sorry, we're all out of Limburger
It's very runny, sir.
It's really very, VERY runny, sir.
----------------------------------------
client : John Cleese
shopkeeper : Michael Palin
sketch : Cheese Shop Sketch
The latter part of the output would be totally ruined if we obfuscate the keyword argument names, which would change the words 'client', 'shopkeeper' and 'sketch'.
I didn't want to try to automatically distinguish every case
where the keyword arguments' names should be obfuscated from
every case where they should not be.
This shortcoming can become a nuisance, because if you're calling
a function with many declared arguments, you might want your call
to mention some declared arguments by name to improve your code's readability,
and/or to help you select which of the function's default arguments
you want used.
Please contact me if you find this issue important
and want me to address it.