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

[pyOpenSci review] make Text a subclass of str instead of a single attribute dataclass #536

Closed
rich-iannone opened this issue Dec 2, 2024 · 1 comment

Comments

@rich-iannone
Copy link
Member

From the pyOpenSci comment:

suggestion (_text.py): Maybe we could make Text a subclass of str instead of a single attribute dataclass. We would get rid of quite a few types checks errors.

pyOpenSci/software-submission#202 (comment)

@machow
Copy link
Collaborator

machow commented Dec 9, 2024

We have changed this to now use an interface called BaseText, with only .to_html() and .to_latex() methods.

The interface now only requires these methods, and does not specify what data / attributes the class should hold. I think this gets back at what the reviewer noted -- with the twist that now our interface now doesn't have opinions on how an object is instantiated.

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

No branches or pull requests

2 participants