repr/str diff between Python 2 and 3

Ben Finney ben+python at benfinney.id.au
Tue Oct 11 22:01:48 EDT 2016


Skip Montanaro <skip.montanaro at gmail.com> writes:

> > Only that one should not rely on ‘str’ preserving the value accurately,
> > as documented in Python 2.
>
> Sure, but this choice is out of my hands. It's csv.writerow that calls
> str(), not me.

Ah, good old ‘csv’.

If the implementation is leaking an abstraction and you can't change the
implementation, then yes, making your test cases aware of the difference
is an option you'll need to consider.

-- 
 \      “Do I believe in God? … without clarification of a kind I have |
  `\    never seen, I don’t know whether I believe or don’t believe in |
_o__)                whatever a questioner has in mind.” —Noam Chomsky |
Ben Finney




More information about the Python-list mailing list