python-aspectlib icon indicating copy to clipboard operation
python-aspectlib copied to clipboard

Pass many objects as target argument in aspectlib.weave method

Open anthonylouisbsb opened this issue 5 years ago • 1 comments

Hello, I have the following piece of code:

if __name__ == '__main__':
   weaving_list = [ShannonDBClient,
                   columns.create_columns_in_bulk,
                   columns.create_single_column]
   with weave(weaving_list, print_debug_log, lazy=True):
       loop = asyncio.get_event_loop()
       loop.run_until_complete(main(args))

I would like to know if it is possible, instead I pass every method name in columns module, I just pass the module name, to reduce the weaving_list variable size.

anthonylouisbsb avatar Jun 10 '20 11:06 anthonylouisbsb

The methods option is supported for modules. Looks like I documented this wrong (states that it's only for classes) - leave this issue open.

ionelmc avatar Jun 10 '20 11:06 ionelmc