Martin Panter added the comment: It would make more sense and be more consistent if the str() and repr() used one’s complement in all cases, i.e.:
self.assertEqual(str(Perm(~0)), "~0") Also, the repr() seems to be doing a bad attempt at Python pseudo code. Instead of <Perm.R|W: 3> maybe it could be something like these: <Perm.R|Perm.W: 3> # Mirroring str() -> "Perm.R|Perm.W" <Perm R|W: 3> <Perm: R|W = 3> I wonder if the addition (+) operator should also be overridden; I haven’t looked, but I suspect some people may do FLAG1 + FLAG2 instead of FLAG1 | FLAG2. ---------- nosy: +vadmium _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23591> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com