This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年04月26日 17:37 by mesheb82, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (2) | |||
|---|---|---|---|
| msg159403 - (view) | Author: mesheb82 (mesheb82) | Date: 2012年04月26日 17:37 | |
I’m running: Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 I was testing out some print functionality and I made an error in typing (I meant to use %8.8f), but is this behavior intentional or is it an error? >> print '%8.8s' %(10000000001.) >> '10000000' I would expect this to return a TypeError. I also tested this on Python 2.4 and Python 2.5 on linux and had the same behavior. Steve |
|||
| msg159409 - (view) | Author: Eric V. Smith (eric.smith) * (Python committer) | Date: 2012年04月26日 18:01 | |
The "s" causes the argument to be converted to a string, then the formatting is applied. So it's working as designed. This is the logical equivalent of: '%8.8s' % str(10000000001.) |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:29 | admin | set | github: 58882 |
| 2012年04月26日 18:01:33 | eric.smith | set | status: open -> closed nosy: + eric.smith messages: + msg159409 resolution: not a bug |
| 2012年04月26日 17:37:43 | mesheb82 | create | |