Roundup Robot added the comment:
New changeset f56b98143792 by R David Murray in branch 'default':
whatsnew: object.__format__ raises TypeError on non-empty string.
http://hg.python.org/cpython/rev/f56b98143792
--
___
Python tracker
Serhiy Storchaka added the comment:
Perhaps the versionchanged tag for format() is more suitable than versionadded.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
R. David Murray added the comment:
Since Eric indicated he'd close this unless someone felt strongly that the
status quo should be changed, and the arguments are in favor of *maintaining*
the status quo, I'm going to close this for him :)
--
nosy: +r.david.murray
resolution: - fixed
Yogesh Chaudhari added the comment:
+1 to Terry for If its class does not override .__format__, then it seems that
it should act the same as a direct object instance
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
Yogesh Chaudhari added the comment:
@Eric:
when you say: If the type of the object really is object, then it can use
string formatting. It's only for non-objects that I want to add the error..
I am confused. Let me demonstrate what I'm thinking according to the statement
above.
First let
Yogesh Chaudhari added the comment:
Please replace
integer.__format__(s)
with
integer.__format__('')
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
Eric V. Smith added the comment:
But int has its own __format__ method, so this does not apply. Per the title of
this issue, this only refers to object.__format__.
For example:
This works now, and will continue working:
format(2, '1')
'2'
This is currently an error, and will remain an
Yogesh Chaudhari added the comment:
It's this case that is currently an error, but it need not be:
format(object(), '1')
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: non-empty format string passed to object.__format__
I believe that should continue to remain an
Changes by Ankur Ankan ankuran...@gmail.com:
--
nosy: +Ankur.Ankan
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
___
Python-bugs-list
Viktor Ershov added the comment:
As I can see this is already implemented in 3.4
--
nosy: +asvetlov, krinart
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
Roundup Robot added the comment:
New changeset d91c14788729 by Andrew Svetlov in branch 'default':
Issue #9856: Replace deprecation warinigs to raising TypeError in
object.__format__
http://hg.python.org/cpython/rev/d91c14788729
--
___
Python
Andrew Svetlov added the comment:
Committed. Thanks.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
Roundup Robot added the comment:
New changeset 2f6ec67636b8 by Andrew Svetlov in branch 'default':
Add NEWS and docs for #9856
http://hg.python.org/cpython/rev/2f6ec67636b8
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
Andrew Svetlov added the comment:
Updated NEWS and docs
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
___
Python-bugs-list mailing
Eric V. Smith added the comment:
The more I think about this, the more overly restrictive I realize it is. If
the type of the object really is object, then it can use string formatting.
It's only for non-objects that I want to add the error.
I'll re-open it and give it some more thought.
Andrew Svetlov added the comment:
Ok
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: -berker.peksag
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
___
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
Changes by Berker Peksag berker.pek...@gmail.com:
--
nosy: +berkerpeksag
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
___
Florent Xicluna florent.xicl...@gmail.com added the comment:
Patch is ready for python 3.4
:-)
--
keywords: +patch
nosy: +flox
Added file: http://bugs.python.org/file23936/issue9856_python-3.4.diff
___
Python tracker rep...@bugs.python.org
Changes by Eric Smith e...@trueblade.com:
--
priority: release blocker - deferred blocker
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9856
___
Eric Smith e...@trueblade.com added the comment:
Next step is to make it a TypeError in 3.4.
--
priority: normal - release blocker
title: Change object.__format__(s) where s is non-empty to a DeprecationWarning
- Change object.__format__(s) where s is non-empty to a TypeError
versions:
22 matches
Mail list logo