S
Steve Holden
See his latest blog entry on artima.com, where he has started a Py3kAlex said:callable and reduce are rarely used, at least in code I've seen.Alex Popescu said:@x40g2000prg.googlegroups.com:
On Jul 21, 7:48 am, Duncan Booth <[email protected]>
wrote:
[snip...]
From the 2.6 PEP #361 (looks like dict.has_key is deprecated)
Python 3.0 compatability: ['compatibility'-->someone should use a
spell-checker for 'official' releases]
- warnings were added for the following builtins which no
longer exist in 3.0:
apply, callable, coerce, dict.has_key, execfile,
reduce,
reload
I see... what that document doesn't describe is the alternatives to
be used. And I see in that list a couple of functions that are
probably used a lot nowadays (callable, reduce, etc.).
I thought G would be using that function a lot. Also, what is the
replacement of reduce? I think I remember seeing somewhere that lists
comprehension would be (but also remember the advise that reduce will be
quicker).
FAQ. He suggests that uses if reduce are almost always more readable
when written using a for loop and an accumulator variable.
http://www.artima.com/weblogs/viewpost.jsp?thread=211200
Yup. Anyway there's a trivial translation for uses of apply.dict.has_key(key) becomes key in dict (correct?)
I think there were some advises to not use apply.
apply(f, *args, **kw) => f(*args, **kw)
The converter will almost certainly do this for you.
I don't ever remember using execfile. It has always been a blot on the
landscape.
I'd have to guess, and will refrain from doing so.What is the replacement for this one?
regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------