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

We only need to suggest methods, not import it #136

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

hadley
Copy link
Member

@hadley hadley commented Jun 16, 2024

No description provided.

@hadley hadley requested a review from cderv June 16, 2024 16:42
Copy link
Collaborator

@cderv cderv left a comment

Choose a reason for hiding this comment

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

We call methods::show in here

render <- function(x) if (isS4(x)) methods::show(x) else print(x)

is this possible that the methods package is not available ?

Or we should check also for it being installed if we want to keep Suggest

- render <- function(x) if (isS4(x)) methods::show(x) else print(x)
+ render <- function(x) if (isS4(x) && requireNamespace("methods", quietly = TRUE)) methods::show(x) else print(x)

This is the practice I follow with Suggest

@hadley
Copy link
Member Author

hadley commented Jun 18, 2024

I don't think it's possible for methods to not be available and to have an S4 object. (i.e. if isS4(x) is TRUE, it implies that methods must be available).

@cderv
Copy link
Collaborator

cderv commented Jun 18, 2024

(i.e. if isS4(x) is TRUE, it implies that methods must be available).

Then it is ok I guess. 👍

@hadley hadley merged commit 3ff4bcd into main Jun 18, 2024
13 checks passed
@hadley hadley deleted the methods-suggest branch June 18, 2024 17:12
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.

2 participants