[Python-Dev] Python Language Summit EuroPython 2010 (original) (raw)
Guido van Rossum guido at python.org
Fri Jul 23 08:44:42 CEST 2010
- Previous message: [Python-Dev] Python Language Summit EuroPython 2010
- Next message: [Python-Dev] Python Language Summit EuroPython 2010
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Thu, Jul 22, 2010 at 6:50 PM, Eric Smith <eric at trueblade.com> wrote:
Thanks for writing this, Tim.
On 7/21/10 11:11 AM, Tim Golden wrote:
The issue of a format equivalent for bytes was also raised as was the idea of object methods to render an object as string or bytes, which could be used in the polymorphic functions above. Does this mean bytes.format, or does it mean bytes.format? bytes.format already exists, but it just calls object.format. I'm not sure what the desired functionality for bytes.format would be. If it means bytes.format, this would be relatively easy to do in CPython, if there's agreement to add it.
Indeed, we meant b'...{}...{}...'.format(x, y). The problem is that it can't invoke x.format() or y.format() since those will return text strings instead of bytes. A proposed solution was to try x.bformat() etc. Another proposed solution was to limit x and y to a small set of common types and hard-code their meanings (e.g. numbers, bytes, and dates).
-- --Guido van Rossum (python.org/~guido)
- Previous message: [Python-Dev] Python Language Summit EuroPython 2010
- Next message: [Python-Dev] Python Language Summit EuroPython 2010
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]