holoviz / param

Param: Make your Python code clearer and more reliable by declaring Parameters
https://param.holoviz.org
BSD 3-Clause "New" or "Revised" License
430 stars 73 forks source link

Use pprint (aka script_repr) for __repr__ #101

Open ceball opened 9 years ago

ceball commented 9 years ago

See #95:

We'd like __repr__ to be like the script_repr of this PR, but (a) Jim objects that using inspect is overkill for __repr__ (but Jean-Luc and I don't see the problem) and (b) __repr__ shouldn't have the indentation that script_repr has.

jbednar commented 9 years ago

It's just a gut feeling about avoiding self-aware code; if it really solves a real problem and makes it simpler to maintain and we don't care whether reprs are particularly fast to generate, then I don't have any objection. But yes, I think we should make a distinction between repr (all crammed onto one line, for various system purposes like debugging), and pprint (currently script_repr), formatted nicely for human beings.

ceball commented 7 years ago

Note: see https://github.com/ioam/param/issues/166#issuecomment-325225105

jlstevens commented 4 years ago

Related to https://github.com/holoviz/param/issues/100 and https://github.com/holoviz/param/issues/396 these should be considered together.