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

Feature : exclude_name_list

Open arita37 opened this issue 3 years ago • 4 comments

Sometimes, we have a very long file of utilities, we want to expose all functions except some names.

It would be useful to have this to filter out some exposure.

fire.Fire(exclude_name_list = [ 'os', 'myfun1*', 'myfun2*'])

arita37 avatar May 18 '22 05:05 arita37

Take a look at #47 and see if that helps you out.

chey avatar May 21 '22 13:05 chey

  1. suppose we have 40 functions, and want to expose all, but exclude only 10….

Having an exclusion list can be helpful.

Renaming to _ is not perfect since those functions can be reused in python code…

arita37 avatar May 21 '22 13:05 arita37

  1. suppose we have 40 functions, and want to expose all, but exclude only 10….

Depending on how you use import ... __all__ could be useful in your situation.

chey avatar May 25 '22 15:05 chey

Thanks for the feature request. I see the value of this and it is something we might consider in the future. It's not currently planned though.

dbieber avatar Sep 13 '22 17:09 dbieber