Skip to content

Default print() and str() trigger deprecated property warnings #754

Description

@thisisnic

I came across this while working on tidyverse/ellmer#1107 and trying to deprecate a property of an S7 class.

The default print()/str() for S7 objects call every property getter, so a deprecated property warns every time the object is printed. The workaround is a custom print() method that filters those properties out, which is what the ellmer PR does.

There's some related discussion in #451, and #734 looks to implement deprecated_property(), but the missing piece is whether, once properties can be formally marked as deprecated, print() should skip them?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions