Skip to content

Reference static class method in gin config #198

@marcoamonteiro

Description

@marcoamonteiro

In the following example I would like to assign a parameter to the static method ImplClass.foo . The reference @ImplClass.foo is not being resolved properly by gin.

from abc import ABC, abstractmethod
import gin

class BaseClass(ABC):
    @staticmethod
    @abstractmethod
    def foo(a):
        pass

@gin.register()
class ImplClass(BaseClass):
    @gin.register()
    def foo(a):
        print("hello")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions