4 ms·
Python has functions, classes, modules, packages. I don't know why separate codebases would be necessary.
by neolog 6y ago
Python has functions, classes, modules, packages. I don't know why separate codebases would be necessary.
- willcipriano 6y agoYou can do stuff like this, Java devs in particular get freaked out by this sort of thing in my experience. (Forgive the formatting) import foo foo.auth("admin", "badpass") returns False def new_auth(user, pass): . . . .return True foo.auth = new_auth foo.auth("admin", "badpass") now returns True
- neolog 6y agoThat's called monkeypatching and it's a last-resort hack, not something you'd just use willy-nilly in production code.