A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025919.html below:

why string substitution is not the same operation as data formatting

[Python-Dev] PEP 292-related: why string substitution is not the same operation as data formatting [Python-Dev] PEP 292-related: why string substitution is not the same operation as data formattingPatrick K. O'Brien pobrien@orbtech.com
Tue, 25 Jun 2002 08:53:28 -0500
[Lalo Martins]
>
> Now, this thing we're talking about is replacing parts of the string with
> other strings. These strings may be the result of running some non-string
> objects trough str(foo) - but, we are making no assumptions about these
> objects. Just that str(foo) is somehow meaningful. And, to my knowledge,
> there are no python objects for which str(foo) doesn't work.

I guess it depends on your definition of "work". This can fail if foo is an
instance of a class with __str__ (or __repr__) having a bug or raising an
exception. If foo is your own code you probably want it to fail. If foo is
someone else's code you may have no choice but to work around it. :-(

--
Patrick K. O'Brien
Orbtech
-----------------------------------------------
"Your source for Python software development."
-----------------------------------------------
Web:  http://www.orbtech.com/web/pobrien/
Blog: http://www.orbtech.com/blog/pobrien/
Wiki: http://www.orbtech.com/wiki/PatrickOBrien
-----------------------------------------------





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4