Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Python: Abstract classes with unused args how to avoid

  • 07-07-2020 04:22PM
    #1
    Registered Users, Registered Users 2 Posts: 5,761 ✭✭✭


    So i have a test framework with an abstract class above sdk REST call and cli functons

    My test case will call the function below and (based on config) will run the sdk or cli as appropriate
    @staticmethod
        @abstract_method
        def create_bucket(bucket_name, compartment_id, operation_kwargs=None, **model_kwargs):
    

    The model_kwargs is only needed in the sdk REST as the CLI simply passes the positional and (if needed) operation_kwargs to it's call.

    Is there a clean way to have this signature, or even alter it to suit both without having unused variable in the signature


Advertisement