Menu

#1 doPyStr and doPyRepr hooks are outdated.

open
nobody
None
5
2008-11-03
2008-11-03
No

The supported way of providing your own str and repr implementation is by adding methods named __str__ and __repr__. So the virtual functions doPyStr and doPyRepr should be phased out. Secondly, old doPyStr sits in the way if only __repr__ is overriden. str(x) should fall back to repr(x), but instead, it will always use the default doPyStr().

Proposition: let default doPyStr() call repr(x) to enable the fallback. And have both flagged deprecated.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB