3 ms·
source looks surprising, for instance the decorators parse the decorated function code and build an AST (still have to find out why)
by tbarbugli 10y ago
source looks surprising, for instance the decorators parse the decorated function code and build an AST (still have to find out why)
- madisonmay 10y agoMy best guess is that this is to circumvent issues with naming encountered by using decorated functions in conjunction with multiprocessing pools. Typically you would run into serialization errors.
- tbarbugli 10y agoit turns out that the decorator "rewrite" the fn code. that's at least how the synchronized decorator does its own magic. Once I saw that in the source code (and other few hacks) I was sure I was never going to use this lib :)