Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Guide to: Learning Python Decorators

285 views
Skip to first unread message

sajuptpm

unread,
Feb 9, 2012, 12:56:36 PM2/9/12
to
Guide to: Learning Python Decorators
New Book http://tinyurl.com/python-decorartor

Terry Reedy

unread,
Feb 9, 2012, 3:28:40 PM2/9/12
to pytho...@python.org
On 2/9/2012 1:55 PM, Arnaud Delobelle wrote:
>
> On Feb 9, 2012 6:00 PM, "sajuptpm" <saju...@gmail.com
> <mailto:saju...@gmail.com>> wrote:
> >
> > Guide to: Learning Python Decorators
> > New Book http://tinyurl.com/python-decorartor

Which goes to Amazon, perhaps with an Amazon Associate id embedded.

> A whole book about decorators? Cool. I'm going to start writing books
> to. I'll start with 'The Python print statement'. Then to be cutting
> edge I'll follow with 'The Python print function'.

Sarcasm aside, it is a small (200K) digital book at a small price ($4).
According to the 5-star reviews, it is not as trivial as the title
indicates. It starts with explaining functions, scope, parameters,
nesting, *args, **kwds, and nesting. In other words, everything one
needs to know to understand decorators. It is based on tutorials given
at PyCon and elsewhere. I plan to borrow it and take a look.

A book on Printing with Python that clearly explained everything one
needs to know about characters, glyphs, fonts, bytes, unicode,
encodings, and serialization in order to print would also be worthwhile.
For a bonus, add in something about console windows, OS differences, and
printers.

--
Terry Jan Reedy

Ian

unread,
Feb 9, 2012, 5:43:09 PM2/9/12
to pytho...@python.org
On 09/02/2012 21:41, Aaron France wrote:
> How many pages is that? The amazon page conveniently left that off.
There is an average of 5.1 chars per word in English, and usually about
350 words an A4 page.

The 215K file is
a) Compressed - typically by 60%
b) Contains simple html and images as its source.
c) Must contain the cover image.

As a *very* rough guess, that means the files expands to 344K.

Remove the cover image at 250-300kb leaves 44 to 94KB

That is 8700 words to 18400 words or approx 25 to 50 pages.

But that is *very* *very* rough.

Regards

Ian

Terry Reedy

unread,
Feb 9, 2012, 10:22:44 PM2/9/12
to pytho...@python.org
The file is about 500 'locations'. The Kindle Users Guide, 3rd Ed., has
1300, Lao Tza, the Art of War, (project Gutenberg), aaabut 2100. I read
about half in an hour. Even knowing the material, it is slower than a novel.

--
Terry Jan Reedy

sajuptpm

unread,
Feb 10, 2012, 1:20:57 AM2/10/12
to

anon hung

unread,
Feb 10, 2012, 1:32:09 AM2/10/12
to Python-list
>> Guide to: Learning Python Decorators
>> New Book http://tinyurl.com/python-decorartor
>
> A whole book about decorators? Cool. I'm going to start writing books to.
> I'll start with 'The Python print statement'. Then to be cutting edge I'll
> follow with 'The Python print function'.

How about 'Tips and tricks about python loops'?

:)


--
Viktor Orban Prime minister of Hungary
http://spreadingviktororban.weebly.com

88888 Dihedral

unread,
Feb 10, 2012, 3:11:13 AM2/10/12
to
I prefer to decorate a function not a method.

I prefer to decorate an object to own a new method from the existed ones
inherited in all the class levels.

I do not decorate a class if not necessary.

I believe this is more pythonic to add functionalities to objects in classes by
aggregated scripts that use similar modules over a period of time.

Jack Diederich

unread,
Feb 12, 2012, 4:04:43 AM2/12/12
to pytho...@python.org
just google "jack diederich decorators" it costs nothing and you get a
free pycon talk out of it.

-Jack

88888 Dihedral

unread,
Feb 12, 2012, 6:48:32 AM2/12/12
to Python-list
在 2012年2月10日星期五UTC+8下午2时32分09秒,anon hung写道:
> >> Guide to: Learning Python Decorators
> >> New Book http://tinyurl.com/python-decorartor
> >
> > A whole book about decorators? Cool. I'm going to start writing books to.
> > I'll start with 'The Python print statement'. Then to be cutting edge I'll
> > follow with 'The Python print function'.
>
There are books about classes in other computer languages, too.

Using decorator is more elegant in reducing the class levels in applications.
Just deep copying an object in more than 10 levels of an inherited class hiarchie is so slow.

88888 Dihedral

unread,
Feb 12, 2012, 6:48:32 AM2/12/12
to comp.lan...@googlegroups.com, Python-list
在 2012年2月10日星期五UTC+8下午2时32分09秒,anon hung写道:
> >> Guide to: Learning Python Decorators
> >> New Book http://tinyurl.com/python-decorartor
> >
> > A whole book about decorators? Cool. I'm going to start writing books to.
> > I'll start with 'The Python print statement'. Then to be cutting edge I'll
> > follow with 'The Python print function'.
>
0 new messages