Initial commit
This commit is contained in:
commit
20eccebd45
|
@ -0,0 +1,2 @@
|
|||
__pycache__/
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import builtins
|
||||
|
||||
_original = builtins.__build_class__
|
||||
|
||||
naughty_list = 'test', 'a', 'b', 'c', 'lewd', 'pony', 'ponies'
|
||||
|
||||
def profanity_filter(func, name, *args, **kwargs):
|
||||
if any(bad_word in name.lower() for bad_word in naughty_list):
|
||||
raise RuntimeError('Disgusting! Thats how you name your classes?!')
|
||||
return _original(func, name, *args, **kwargs)
|
||||
|
||||
def disallow_profanity():
|
||||
builtins.__build_class__ = profanity_filter
|
||||
|
||||
def allow_profanity():
|
||||
builtins.__build_class__ = _original
|
||||
|
||||
disallow_profanity()
|
Loading…
Reference in New Issue