acton icon indicating copy to clipboard operation
acton copied to clipboard

Move `__str__`, `__repr__` and `__bool__` from all objects to separate protocols

Open plajjan opened this issue 3 years ago • 2 comments

Protocols names?

  • Boolable / Bool
  • Stringable / Str

Does __repr__ need its own protocol or does it go into Stringable?

plajjan avatar Nov 04 '22 11:11 plajjan

@sydow we discussed this yesterday and I got the feeling you were eager to pick this up sooner rather than later. Should we decide on the protocol names we want? :)

plajjan avatar Jan 30 '25 13:01 plajjan

Absolutely. I have neither strong views nor clever ideas. I could think of Bool for the protocol which contains only bool and Str for the one with str and repr. The latter could also be Print or Printable, but that may give wrong associations. Other ideas?

Björn

sydow avatar Jan 30 '25 13:01 sydow