beeprint icon indicating copy to clipboard operation
beeprint copied to clipboard

Feature request: do not print object's attributes which start with a `_`

Open ghost opened this issue 8 years ago • 0 comments

Currently, if we print an object, every attribute starting with an _, which we want to hide in class implementation, is printed. Can we add an option to hide those attributes? For example,

class A:
    def __init__(self):
        self._a = 1
        self.b = 2

>>> from beeprint import pp

>>> pp(A())
instance(A):
  _a: 1,
  b: 2

But I do not want A._a to be printed. Could you please make it?

ghost avatar Dec 21 '17 19:12 ghost