Message310404
So if I understand correctly: the default value of the "repr" parameter is True.
Decision matrix: does dataclass insert a __repr__ into the class?
+-- row: argument passed in to decorator's repr parameter
|
|
v | yes | no | <--- columns: does the class have a __repr__?
-------+---------+---------+
True | ??? | yes |
-------+---------+---------+
False | no | no |
-------+---------+---------+
If the user specifies "repr=True", and also specifies their own __repr__ in the class, does dataclasses stomp on their __repr__ with its own? Does it throw an exception?
I still prefer the tri-state value here. In this version, the default value of the "repr" parameter would be None, and the decision matrix for inserting a __repr__ looks like this:
+-- row: argument passed in to decorator's repr parameter
|
|
v | yes | no | <--- columns: does the class have a __repr__?
-------+---------+---------+
True | raise | yes |
-------+---------+---------+
None | no | yes |
-------+---------+---------+
False | no | no |
-------+---------+---------+
But we've talked about using the tri-state default for all of these parameters before, and clearly you weren't swayed then, so I guess I've said my peace and I'll stop suggesting it. |
|
| Date |
User |
Action |
Args |
| 2018-01-22 08:58:14 | larry | set | recipients:
+ larry, eric.smith, levkivskyi |
| 2018-01-22 08:58:14 | larry | set | messageid: <1516611494.91.0.467229070634.issue32513@psf.upfronthosting.co.za> |
| 2018-01-22 08:58:14 | larry | link | issue32513 messages |
| 2018-01-22 08:58:14 | larry | create | |
|