Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Python: Abstract classes with unused args how to avoid

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


    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