Skip to content

[Feature Request] Allow setting default value for lazy for all API calls #2334

@Zocker1999NET

Description

@Zocker1999NET

As I'm already familiar with lazy objects & workflows, I would like it to have lazy==True to be the default. But because this may be not the best for everyone, I propose adding a default lazy argument to the initial Github class constructor which becomes the default for every method called by it. If I gain some time, I will look into implementing it myself. However if someone else is faster to implement it, feel free to implement & submit it yourself.

This may be implemented by adding a variable to Github which holds the global default, can be set by using the constructor and defaults to False (to keep the current behavior the default). Then every method supporting lazy behavior may either look up this global default by itself or a decorator is implemented which replaces the lazy parameter by itself. The default for the method's argument should be set to None. Then the following comparison code can be used to resolve the value to use:

lazy_global_default if lazy_method_arg is None else lazy_method_arg

(This issue serves as a reminder for myself.)

PS: This library looks really good & is easy to use, thanks for the work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions