On 3/21/07, BJörn Lindqvist <[EMAIL PROTECTED]> wrote:
> I think so too. Aliasing names is easy to do, but uglifies things.
> Plus, if you do it that way, can you still emit DeprecationWarnings?
Sure.
def oldname(arg):
"Deprecated version of newname"
warn("Use newname instead", DeprecationWarning)
return newname(arg)
> The patches eliminate the set.option_callback variable and the
> Telnetlib.set_option_negotiation_callback() method. The problem has an
> extra twist because the old way is mutually exclusive with the new
> way. Or well, you could support them both but that would make the
> class extra ugly.
Not really. The default handle_option could look for (and call) a
callback. If you don't want to mess with refixing the sbdataq, you
could just change the call sites. Right now, they already all say
if self.option_callback:
self.option_callback(...)
else:
# fallback
Make that either
# Support the deprecated callback in 2.6
if self.option_callback:
self.option_callback(...)
else:
self.handle_option(...)
or
# Support the deprecated callback in 2.6
if self.option_callback:
self.option_callback(...)
elif not self.handle_option(...):
# fallback
-jJ
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com