A collection of brief codes, quite useless or unlikely applicable, to solve in a shorter or involved manner some relatively simple problems.
Problems that, for majority of cases, come from my friend and colleague Emmanuel Schoysman, and which he uses to torture me for days and days. 😄
Ok, there could be serious things too... but it's not guaranteed. 😛
Is there a way to make a module-in-the-middle attack? To run a filter between a module importer and a module imported from it? To intercept and alert about deprecations?
A first experiment (lacking of the class patching part) around PEP 562. Wrapper, diverted and main modules.
(for a single module redirection, see the repo tree under moduleWrapping/singleModule)
What's imported? What's used from this import?
A experiment to discover it statically, using ast: code
(manually run by command-line with your .py as argument, i.e.: "py -3.7 customsStaticAnalyzer.py your.py")
A exercise/challenge to build a (monstrous) regex to split a string, in all possible cases.
A code density exercise, to apply different functions on list items according to satisfied predicates.
An attempt to use regex for padding; in practice, a replacing example using a function rather than a pre-determined string.
A challenge to minimize the well-known function for modular exponentiation.