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

Add default upcasting convert() method #444

Merged
merged 8 commits into from
Sep 23, 2024
Merged

Conversation

t-kalinowski
Copy link
Member

@t-kalinowski t-kalinowski commented Sep 19, 2024

Closes #430.
Maybe also closes #420?

Copy link
Member

@hadley hadley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like this idea and the implementation looks reasonable to me.

I mostly commented with general S7 design thoughts 😄

R/convert.R Show resolved Hide resolved
R/convert.R Outdated Show resolved Hide resolved
R/convert.R Outdated Show resolved Hide resolved
@lawremi
Copy link
Collaborator

lawremi commented Sep 22, 2024

Thanks for doing this. It does seem to resolve #420.

Copy link
Collaborator

@mmaechler mmaechler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also like the UI with convert() both for up- and down- casting very much.
I've not studied the changes in detail, but also agree with Hadley's focus on thinking about encapsulating reusable functionality into helper functions .. which are hidden for now but may well be exported to the advanced S7 users eventually (and in part).

@t-kalinowski t-kalinowski merged commit 15a01a3 into main Sep 23, 2024
11 checks passed
@t-kalinowski t-kalinowski deleted the feature/upcasting-convert branch September 23, 2024 13:24
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

Successfully merging this pull request may close these issues.

Could convert() also downcast by default? Allow "seed" arguments to constructors
4 participants