minor nit - anonymous block of code

Skip to first unread message

Robert L

May 30, 2011, 10:46:29 AM5/30/11
to Building Skills Books
url: http://homepage.mac.com/s_lott/books/python/html/p01/p01c10_adv_func.html#functions-and-namespaces

"Each module, class, function, lambda, or anonymous block of code
given to the exec command has its own private namespace."

Please consider whether or not it is appropriate for someone starting
to learn Python to be exposed to "anonymous block of code".

As a newbie to Python, the phrase "anonymous block of code" got my
attention and I wanted to find out what it meant. The word "anonymous"
was mentioned in only one other spot in your book (The Lambda)

url: http://homepage.mac.com/s_lott/books/python/html/p02/p02c10_adv_seq.html#the-lambda

I googled "Python anonymous block of code" and ran across the
following "Python has anonymous functions, but they're not allowed to
contain "statements," just an "expression." Hence, if you want Python
to use "custom logic," you need to create a function with a name (not
an anonymous function) and pass the name around. Why can't an
anonymous Python function contain statements? You'll have to ask
Guido. This has been hashed over ad nauseum in the Python world, and
it makes my eyes glaze over. "

url: http://convincemetousepython.blogspot.com/2008/04/functions-versus-blocks.html

At that point, I decided that it was an advanced topic that I would
come back to later.

Perhaps, your goal was to plant the seed in the students mind?

Either way, please consider blogging about the use of "anonymous block
of code". In my professional career in the Oracle database, I have
seen "anonymous block of code" severely abused which led to much
"what's is it doing?".

url: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/overview.htm#sthref258

Steven F. Lott

May 30, 2011, 4:31:52 PM5/30/11
to building-s...@googlegroups.com, Building Skills Books
I'm sorry you had to think. That, however, is my actual objective. It's not actually of any value to present simplistic things that precisely meet your assumptions. That would not be "learning", merely confirming.

Sent from my iPhone

Reply all
Reply to author
0 new messages