2012-07-05

At Europython I learned...

Today I learned something magical that has transformed all my twisted
program examples:

from __future__ import print_function

Whee! This means that you can quickly and easily do
d.addCallback(print) without any pain. You can even do
d.addCallback(print, 'somedata', 1, 'etc').

>>> d = defer.succeed(None)
>>> d.addCallback(print, 'somedata', 1, 'etc')
None somedata 1 etc


Huzzah!

6 comments:

Cory said...

Oh shit son, that is great. Thanks for the tip.

Anonymous said...

thanks a lot!!!!
great great
the end of my stupid function "printit"
it seem's that print "toto" still work also.
that's the best day of my life

wordpress plugins said...

Divine Developer specializes in personalized WordPress consulting services. Featured services include custom plugins and themes coding, PSD to WordPress services, migration to wordpress and upgrades.

kancelarijske stolice said...

ANAKS is a company specializing in the sale of office furniture and furnishing office space. Like the company name says (ANAKS is the ancient Greek word for the best, leading, ruler), we strive to provide our customers with the best service, the best selection and the best quality. Our product range includes furniture and chairs for your business well-known manufacturers.
http://www.anaks-namestaj.com/

rent a car beograd said...

Really loved reading your blog. Thanks for sharing this!

GoldyVPN said...

Once you unblock rai tv you will experience high speed so you can easily test your gaming skills. You will be able to use vpn for rai tv from anywhere in the world.
http://www.goldyvpn.com/vpn-for-rai-tv/