Mark Lawrence breamore...@yahoo.co.uk added the comment:
No reply to msg71746.
--
nosy: +BreamoreBoy
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1504
___
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Must this still be open?
--
nosy: +benjamin.peterson
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
___
Guido van Rossum added the comment:
Exactly. I'm proposing that we don't bother with people who call
types.MethodType(), but we *do* bother converting code that calls
new.method().
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
Guido van Rossum added the comment:
Aren't there equivalent ways to spell those with the new module? How
about a fixer for that code (which may be easier to write)?
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
__
Guido van Rossum added the comment:
Does this still need to remain open?
--
priority: - normal
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
__
___
Guido van Rossum added the comment:
You are right about the rest. Can you start a discussion on the list?
Well the only question is where to put these symbols, right? I guess I
still like putting them in sys best, for the ones that don't fit in
collections.
The last time I tried to kick off
Christian Heimes added the comment:
The deprecation warning in 'new' is a -3 warning. I've added a new
method warning.warnpy3k for the job.
You are right about the rest. Can you start a discussion on the list?
The last time I tried to kick off a poll it ended up a lots of bad jokes. :(
Christian Heimes added the comment:
Whatever you say. But shouldn't we make people to use types.MethodType()
or whatever we use as the new module for PyMethod_Type()? People are
going to use types.MethodType() when they see the deprecation warning.
By the way I've updated the docs in r59248.
Christian Heimes added the comment:
Some cases aren't covered by the fixer. I'm not sure if we need fixers
for two cases:
Python 2.x:
Cls.method = types.MethodType(function, None, Cls)
Python 3.0:
Cls.method = function
Python 2.x:
instance.method = types.MethodType(function, instance,
Guido van Rossum added the comment:
Whatever you say. But shouldn't we make people to use types.MethodType()
or whatever we use as the new module for PyMethod_Type()? People are
going to use types.MethodType() when they see the deprecation warning.
Well, if new.method is deprecated, then
New submission from Christian Heimes:
Todo:
im_self - __self__
im_func - __func__
im_class - __self__.__class__
instancemethod(func, self, cls) - instancemethod(func, self)
--
assignee: collinwinter
components: 2to3 (2.x to 3.0 conversion tool)
keywords: py3k
messages: 57870
nosy:
Guido van Rossum added the comment:
Crys, why don't you give it a try yourself? It's quite easy to write
such a simple substitution.
--
nosy: +gvanrossum
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
__
Christian Heimes added the comment:
Added fix_methodattrs with an unit test in r59196. Can you check it please.
By the way how do you know my IRC nick? Are you lurking in #python? :)
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
Guido van Rossum added the comment:
It works, though the __self__.__class__ substitution is technically
wrong -- it creates a single NAME node whose contents is that string,
while in the parse tree it should really be three tokens. But as it
works, I wouldn't worry about it.
I saw you sign a
Christian Heimes added the comment:
You are too fast. I haven't written a fixer for new.instancemethod yet.
Do we need one?
--
status: closed - open
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1504
__
Christian Heimes added the comment:
How should I issue a warning in the new module? Should and can I check
for the -3 warning option or should I warn w/o checks for the -3 option?
from warnings import warn as _warn
_warn(The 'new' module is not supported in 3.x,
DeprecationWarning, 2)
Guido van Rossum added the comment:
There's C code like this:
if (Py_Py3kWarningFlag
PyErr_Warn(PyExc_DeprecationWarning,
apply() not supported in 3.x) 0)
return NULL;
I don't know how to check for that flag in Python though -- we
Christian Heimes added the comment:
Guido van Rossum wrote:
Guido van Rossum added the comment:
There's C code like this:
if (Py_Py3kWarningFlag
PyErr_Warn(PyExc_DeprecationWarning,
apply() not supported in 3.x) 0)
return NULL;
I
18 matches
Mail list logo