I've read the documentation on repr() but I have a feeling that it may be more useful than the docs are giving it credit for. If my speculative feeling is correct, is someone able to provide instances with which repr() comes into its own.
Related questions
Related questions
- The Overflow Blog
-
-
- Featured on Meta
-
-
Linked
Hot Network Questions
- Extreme outlier in real data
- To pretwist or not between two solids and one stranded?
- What is the difference between V-inf+ことない and V-stem+ない
- What physical changes to the mouth would cause problems with articulation?
- Simple current source with bjt
- strange use of вышел
- Resolving skyscraper sheaves on a quadric using spinor bundles
- Blind Spot Regarding the Correlation Coefficient
- Number of subgroups in a semidirect product
- What game languages are most valuable for a highly multilingual character in Pathfinder Society play?
- how to define an expandable key-value command?
- The Airbus A320 that pitched down due to solar radiation recently. Why did that happen? I thought the computers vote the corrupted one out and ignore?
- Can missed approach procedures be used for a PT?
- Why did Jesus say that he is the light of the world while in it?
- What are the events in Parliament Square and Sieges Allee that Woolf refers to in A Room Of One's Own?
- Creating a spiral
- What damages are recoverable for late delivery of a package?
- Full-bridge rectifier causes strange slow oscillation of the DC voltage envelope
- If photons are the carriers of the electromagnetic force, why isn't electricity made of photons?
- Finding Inverse of a 3x3 Matrix with Cayley-Hamilton, and Diophantine Equation
- algorithm2e - Functional programming style match-with using custom Switch
- Any concerns using blown-in cellulose without blower in a small cavity between cathedral ceiling and roof?
- Formal and intuitive definitions of nilpotent group
- In ITT, are all provable equalities in the empty context provable by refl?
lang-py
repr()for me is to show debug output of complex data structures. Whilestr()should give a representation which is less technical (e. g.Martin Shultz, developer), therepr()should give a version which can be read as Python source and ideally will create that object anew (e. g.Person('Martin', 'Shultz', 'developer')), although this often is not possible for complex objects, of course.