goombas.org
menu
main
links
all items
rss feed

Topics:
coding
games
goombas.org
horror
judgement
life
minutiae
music
rants
software
fool.
 _-
 oO
 |/
/|
/ \
Ugh, stop twitching
functional python
coding Posted 2006-08-10 03:54:03 by Jim Crawford
To those complaining about the planned removal of reduce() from Python, I have four lines of code for you:
def reduce(func, seq):
  result = seq[0]
  for elem in seq[1:]: result = func(result, elem)
  return result
lambda is a bit harder to replace, admittedly, but I don't think naming your one-off functions is too egregious a requirement.
[link to this] [See more on “coding”]

comments
add a comment
Only anonymous comments are available for now until I get the user system up and running again. Not many people were logging in anyway, so enh.
Permitted HTML tags: <b>, <i>, <u>, <tt>. Also permitted is the <q> pseudo-tag which is meant to delimit quotes from other messages.
name:
email:
subject:
body:
Preview
To prove you are sentient, please type "sentient" into this box

what's this?
This is Jim Crawford's blog. Details and contact information.

On Twitter: @mogwai_poet

recent comments
Great Review (Anonymous on may 2013 microblog digest)
Outlook Support Phone Number (Anonymous on take a key for coming in)
Aol Support Phone Number (Anonymous on take a key for coming in)
Sage Support Phone Number (Anonymous on take a key for coming in)
Quicken Support Phone Number (Anonymous on take a key for coming in)
Quickbooks Technical Support Phone Number (Anonymous on take a key for coming in)
http://outlook
tech.supportph
one-number.com
/ (Anonymous on take a key for coming in)
Aol Support Number (Anonymous on take a key for coming in)
Sage Support Number (Anonymous on take a key for coming in)
Quicken Support Number (Anonymous on take a key for coming in)
QuickBooks Support Number (Anonymous on take a key for coming in)
Do you know how to get Sage 50 Support (Anonymous on comments are back)
Do you know how to get Sage 50 Support (Anonymous on eye-tracking)
Packers And Movers Bangalore Local Shifting Charges (Anonymous on may 2014 microblog digest)
ISO 9001 Certification in Bangalore (Anonymous on eye-tracking)
Comments RSS