March 11, 2005
Guido's thinking about ditching lambda, reduce(), filter() and map(). I don't use any of them, so I'd be quite happy to see them go, and the proposed product(), any() and all() functions look really good.
I'm with Peter, though - they shoudn't be builtins. We have enough of those already. I seem to remember the martellibot proposing a reductions module at some point. That would be a much better place for them - and for sum(), for that matter. Not only would that avoid bloating the builtins, it would also help to avoid the problem of people already having objects named 'any' or 'all'.
Posted to Python by Simon Brunning at March 11, 2005 01:36 PM
Why does it hurt to have a couple more builtins? They just sit there harmlessly, they don't hurt anyone, they don't require heavy lifting.
For little pieces of functionality, an in-line lambda can often be slipped in. In that case, a nested function would add at least three lines: the def, the return statement, and the blank line separating it from the rest of the code.
Even so, I don't use lambda much so it wouldn't be a deal-breaker if it were removed from the language.
Well, I'm sure nested function one-liners would become accepted practice if lambda went away.
Everything in the builtins is effectively a reserved word. (I know that it's not *really* a reserved word, but it's bad style, it's *really* bad style, to use a builtin's name for anything else.) That's why I would like to see the set of builtins kept as small as possible.
BTW, Greg Ewing suggested over on python-dev that we don't necessarily need a *new* module here - this stuff all fits into the itertools module pretty well. I'm about a +0.5 on that.
The only place I use lambda is when getting back a query from a database where I'm selecting a single column from a table (eg, "select name from user"). In this case the you get a a tuple of single-element tuples (eg, (('Simon',),('Bob',),('Alan',),('Ian',)) ). I'll embed the query in a map(lambda x: x, db.query(...)). I get rid of the inner single-element tuples and can safely do a "for name in names:" where if I don't do that a "for name, in names:" will throw an exception on the query getting an empty answer.
I know I could do
for name in names:
something = name
but I don't like it.
There's probably a better way without using a lambda, but it works for me.
Hank: [x for x in db.query(...)], or if you want to use the map(), operator.itemgetter(0) creates for you what you take lambda for.
All the others:
from itertools import * # There, wasn't that easy?
DYNAMICKICKS OFFERS THE FRESHEST SOPHISTICATED URBAN GEAR ON THE NET FOR THE CHEAPEST PRICES AVAILABLE. WHY PAY TWICE AS MUCH AT RETAIL STORES?
Dynamickicks offer designer clothes, shoes, watches, eye glasses, kids clothes and shoes, bags for men and women, caps, belts, scarfs, wallets and glasses.
Our line up include Gucci, Louis Vuitton, Fendi, Burberry, Lacoste, Polo, UGG, Prada, Rolex, Ed Hardy, Coach, Nike, Air Jordan, Puma, Adidas, Chanel, Dolce and Gabbana, G-star, Levis, True Religion, DIesel, Coogi, Evisu, Bathing Ape, Red Monkey, Laguna, Crown Holder, Christian Audigier, BBC and many more.
WE WILL ALWAYS GET YOU RIGHT FROM HEAD TO FEET WITH OUR LARGE INVENTORY OF DESIGNER GEAR.
WE OFFER FREE SHIPPING WORLDWIDE WITH EMS EXPRESS SO INTERNATIONAL CUSTOMERS ARE ALSO VERY WELCOME TO SHOP WITH US.
PAY WITH CREDIT CARD OR GOOGLE CHECKOUT AND GET AN EXTRA $5 OFF YOUR PURCHASE. WE ALSO ACCEPT PAYPAL FOR YOUR CONVENIENCE.
OUR PROMISE TO YOU:
Provide 24/7 customer support.
Offer our customers the LOWEST prices.
Streamline the buying and paying process.
Deliver goods to our customers all over the world with speed and precision.
Ensure the excellent quality of our products.
Insanity Workout is a 60-day total body p90x cheap conditioning program created by Beachbody (also the creators of the P90X Workout). There workout review are 10 different workouts that introduce you to a range of plyometric and ab exercises. With Insanity Workout, Shaun T is the trainer pushing participants p90x workout to their max. In fact the secret behind Insanity Workout is MAX Interval Training. With MAX Interval Training there are long intervals of exercises with very short breaks in between. This is a direct contrast to traditional interval training which consists of short intervals of exercise with long breaks between p90x reviews your intervals. Insanity requires no equipment - just the will to get into the p90x best shape of your life and have the body you've always wanted. Since INSANITY focuses on cardio and plyometrics, over the course of 60-days it slims and strengthens bodies.
P90X Workout is a 90-day training program does p90x work specifically designed to build lean muscle. The P90X workouts run the gamut covering everything from Chest and Back to insanity Yoga X and X Stretch. Trainer Tony Horton guides p90x participants through all 12 workouts getting them to give it their all. With P90X, as p90x opposed to Insanity Workout, there is some equipment required. For P90X you will need a pull-up bar and either some dumbbells or a resistance band. The magic behind P90X Workout is Muscle Confusion. Muscle Confusion is the concept of never allowing your muscles to plateau by always introducing different workouts. With P90X expect a lot of push ups, pull ups, and insanity workout other strength exercises that continually challenge your muscles.
So when comparing Insanity Workout to P90X p90x Workout, the major difference is the types of exercises. Insanity involves a ton of cardio and insanity plyometric that will leave you constantly sweating and reaching for your water bottle. P90X Workout will wear down your muscles to the point of exhaustion. Also, since P90X Workout does require some equipment it also requires slightly more physical space to do the workouts. Another thing to consider p90x is what is your timeline to getting in shape? Do you have a class reunion or wedding that you insanity need to get fit for? Insanity Workout is a 60 day program whereas P90X is a 90 day program (and yes the 90 in P90X is because it's a 90 day workout program).