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?
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 customprint()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?