add __format__ to
IntEnum with simple logic that says if not
letter format code is present, use string formatting, otherwise use int
formatting.
Yes, that's exactly how it's supposed to be used, and why __format__
exists at all.
That should be future proof.
Agreed.
It does mean
Ethan Furman added the comment:
Drat. IntEnum is supposed to be a drop-in replacement for int. I guess I'll
have to consider more than just the letter
code to decide whether to go with int.__format__ or str.__format__.
--
___
Python tracker
Roundup Robot added the comment:
New changeset ef037ad304c1 by Raymond Hettinger in branch '2.7':
Issue #18031: %-formatting isn't dead yet and might pull through.
http://hg.python.org/cpython/rev/ef037ad304c1
--
nosy: +python-dev
___
Python tracker
Roundup Robot added the comment:
New changeset e1d6140b02f0 by Raymond Hettinger in branch '3.3':
Issue #18031: %-formatting isn't dead yet and might pull through.
http://hg.python.org/cpython/rev/e1d6140b02f0
--
___
Python tracker
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18031
___
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti
type: - enhancement
versions: +Python 3.3, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18031
___
Martin v. Löwis added the comment:
Can you please provide some context for this report?
On the abstract, I agree that there is an error in the tutorial: it is not
decided whether the % formatting will be eventually removed, and I would also
personally disagree with the recommendation to
Carlos Nepomuceno added the comment:
According to what I have been told at python-l...@python.org str.__mod__() is
not going to be deprecated and that seems to be a myth created by Python's own
documentation.
I do remember to have read previously in another page that it would be
deprecated
Changes by Ned Batchelder n...@nedbatchelder.com:
--
nosy: +nedbat
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18031
___
___
Python-bugs-list
Eric V. Smith added the comment:
I agree that we should not say that %-formatting will be removed from the
language. Not until Python 5000, anyway.
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18031
/tutorial/inputoutput.html#old-string-formatting
--
assignee: docs@python
components: Documentation
messages: 189791
nosy: Carlos.Nepomuceno, docs@python
priority: normal
severity: normal
status: open
title: The Python Tutorial says % string formatting will be removed
versions: Python 2.7
Roundup Robot added the comment:
New changeset 21fb1767e185 by Mark Dickinson in branch '2.7':
Issue #14700: Fix buggy overflow checks for large precision and width in
new-style and old-style formatting.
http://hg.python.org/cpython/rev/21fb1767e185
--
Roundup Robot added the comment:
New changeset 102df748572d by Mark Dickinson in branch '3.2':
Issue #14700: Fix buggy overflow checks for large precision and width in
new-style and old-style formatting.
http://hg.python.org/cpython/rev/102df748572d
New changeset 79ea0c84152a by Mark Dickinson
Mark Dickinson added the comment:
Fixed in 2.7 and 3.2; extra tests ported to 3.3 and default. Reclosing.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
Serhiy Storchaka added the comment:
Mark, can I help?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
___
Python-bugs-list mailing list
Mark Dickinson added the comment:
Re-opening: this should probably also be fixed in 2.7 and 3.2. See issue 16096
for discussion.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
Changes by Mark Dickinson dicki...@gmail.com:
--
resolution: fixed -
status: closed - open
versions: -Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
Mark Dickinson added the comment:
Here's a patch for 2.7.
--
Added file: http://bugs.python.org/file27471/formatting-overflow-2.7.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
Mark Dickinson added the comment:
And for 3.2
--
Added file: http://bugs.python.org/file27472/formatting-overflow-3.2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
Changes by Mark Dickinson dicki...@gmail.com:
Added file: http://bugs.python.org/file27473/formatting-overflow-3.2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
Changes by Mark Dickinson dicki...@gmail.com:
Removed file: http://bugs.python.org/file27472/formatting-overflow-3.2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14700
___
Serhiy Storchaka added the comment:
Only one comment. test_formatting_huge_precision should use not sys.maxsize,
but _testcapi.INT_MAX. Other tests can use _testcapi.PY_SSIZE_T_MAX.
I think this tests are worth to add for 3.3 and 3.4. Your old test for this bug
(064c2d0483f8) actually does
Mark Dickinson added the comment:
Thanks for reviewing. I was being lazy with the checks; I'll fix that.
Agreed that it's worth forward porting the tests to 3.3 and 3.4; I'll do that.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
For your information, I fixed recently PyUnicode_FromFormatV() to detect
overflows on width and precision:
changeset: 79543:d1369daeb9ec
user:Victor Stinner victor.stin...@gmail.com
date:Sat Oct 06 23:05:00 2012 +0200
files:
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25875/ship4.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25872/ship1.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25880/ship9.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25873/ship2.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25885/ship14.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25886/ship15.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25887/ship16.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25891/ship20.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25892/ship21.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25894/ship23.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25895/ship24.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25874/ship3.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25876/ship5.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25877/ship6.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25898/ship27.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25878/ship7.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25879/ship8.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25899/ship28.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25881/ship10.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25882/ship11.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25901/ship30.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25883/ship12.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25884/ship13.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25903/ship32.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25888/ship17.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25889/ship18.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25890/ship19.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25893/ship22.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25906/ship35.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25896/ship25.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25897/ship26.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25908/ship37.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25900/ship29.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25902/ship31.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25904/ship33.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25911/ship40.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25905/ship34.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25912/ship41.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25907/ship36.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25909/ship38.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25910/ship39.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25913/ship42.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25915/ship44.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25914/ship43.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25916/ship45.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25917/ship46.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25918/ship47.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25919/ship48.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25920/ship49.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25921/ship50.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25922/ship51.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25923/ship52.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25924/ship53.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25925/ship54.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25926/ship55.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25927/ship56.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25928/ship57.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25929/ship58.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25930/ship59.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25931/ship60.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Fyrn Jilot fyrn7...@yahoo.com:
Added file: http://bugs.python.org/file25932/ship61.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25872/ship1.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25873/ship2.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25874/ship3.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25876/ship5.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25875/ship4.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25877/ship6.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25878/ship7.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25879/ship8.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25880/ship9.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25881/ship10.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25882/ship11.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25883/ship12.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25884/ship13.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25885/ship14.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
Changes by Ned Deily n...@acm.org:
Removed file: http://bugs.python.org/file25886/ship15.html
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1009
___
___
301 - 400 of 978 matches
Mail list logo