Closed sckott closed 5 years ago
Sorry for taking so long to respond! There isn't a way to make those methods private in B
-- if they became private, then a user couldn't count on B
being an implementation of A
.
I think you could make a print method that hid the inherited methods, by comparing environment(foo1)
with the .__enclos_env__
-- if they match, then the method is not inherited.
okay, thanks
If I have an R6 class like
Then another class that inherits
A
likeThe methods in
A
are public inB
Is there any way to avoid public methods from
A
being public inB
? It's not a big problem, it's just that when e.g. there's a classA
with a lot of methods, andB
has very few, the user sees a lot of methods from the inherited class (A
) and very few fromB
, sort of "polluting" the focus of the target classB
thanks!