Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specification and Check of Data Type of the attribute #1

Open
fhaselbeck opened this issue Jan 18, 2022 · 1 comment
Open

Specification and Check of Data Type of the attribute #1

fhaselbeck opened this issue Jan 18, 2022 · 1 comment

Comments

@fhaselbeck
Copy link

Hi,

this is a very useful feature, thanks a lot for your work!
It would be great if there would also be the functionality to specify the data type of the attribute that needs to be implemented.

Do you have any ideas on that?

Thanks and kind regards
Florian

@aemonge
Copy link

aemonge commented Feb 9, 2023

Try this, it seems to be working for me

class Animal( metaclass=ABCMeta):
  @abstract_attribute
  def edible(self) -> list[str]|None:
    pass

Though, I would like to avoid the |None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants