Python-URL! - weekly Python news and links (Nov 17)

G

Gabriel Genellina

QOTW: "I stopped paying much attention to this thread a while ago, but
you've got to admire the persistence of somebody who soldiers on even
though Aahz, Fredrik Lund, and Steve Holden are all on the other side of
the argument..." - Grant Edwards
http://groups.google.com/group/comp.lang.python/msg/91db52ef3a5b98b7


Duck-typing and type assertions: how much to check for type validity:
http://groups.google.com/group/comp.lang.python/t/6c71ab21ba5eeb49/

Why do generators have separate next() and send methods?
http://groups.google.com/group/comp.lang.python/t/e179dcd356c78d78/

Explicit self is here to stay:
http://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to-stay.html

Pros and cons of using "private" parameters to store function state
across calls:
http://groups.google.com/group/comp.lang.python/t/d4c4adb365ab9f41/

How to obtain a reference to the "current" module:
http://groups.google.com/group/comp.lang.python/t/685d3459fed28a53/

A regular expression to match all Unicode punctuation characters:
http://groups.google.com/group/comp.lang.python/t/e6d9d7b7ea39df86/

sqlite3 and MySQLdb cursors behave differently in certain cases:
http://groups.google.com/group/comp.lang.python/t/8ca7a8bb834ff65e/

Unrelated types are not comparable by default in Python 3 - so a list
conta= ining a few None elements cannot be sorted. [plus: the intended
usage of lists, tuples, and a hypothetical `frozenlist` type]:
http://groups.google.com/group/comp.lang.python/t/84e648f03f33210b/

An inspiringly unusual use of Python:
http://pythonide.blogspot.com/2008/10/how-to-make-money-with-free-software.html

The way editors handle indentation -triggered by speech
recognition- should be improved:
http://groups.google.com/group/comp.lang.python/t/3da481c2956bf0b7/

Handling errors by means of exceptions: best practice:
http://groups.google.com/group/comp.lang.python/t/91b79ddbbd309030/

Inverting a dictionary - that is, building its inverse mapping from
value to list of keys:
http://groups.google.com/group/comp.lang.python/t/b6a31d9497f21c62/

Candidate to *Longest and Most Boring Thread of the Year* - started
more than a month ago, currently discussing "The official definition
of call-by-value", and "What't the value of an object":
http://groups.google.com/group/comp.lang.python/t/6163956596a8c082/


========================================================================
Everything Python-related you want is probably one or two clicks away in
these pages:

Python.org's Python Language Website is the traditional
center of Pythonia
http://www.python.org
Notice especially the master FAQ
http://www.python.org/doc/FAQ.html

PythonWare complements the digest you're reading with the
marvelous daily python url
http://www.pythonware.com/daily

Just beginning with Python? This page is a great place to start:
http://wiki.python.org/moin/BeginnersGuide/Programmers

The Python Papers aims to publish "the efforts of Python enthusiats":
http://pythonpapers.org/
The Python Magazine is a technical monthly devoted to Python:
http://pythonmagazine.com

Readers have recommended the "Planet" sites:
http://planetpython.org
http://planet.python.org

comp.lang.python.announce announces new Python software. Be
sure to scan this newsgroup weekly.
http://groups.google.com/group/comp.lang.python.announce/topics

Python411 indexes "podcasts ... to help people learn Python ..."
Updates appear more-than-weekly:
http://www.awaretek.com/python/index.html

The Python Package Index catalogues packages.
http://www.python.org/pypi/

The somewhat older Vaults of Parnassus ambitiously collects references
to all sorts of Python resources.
http://www.vex.net/~x/parnassus/

Much of Python's real work takes place on Special-Interest Group
mailing lists
http://www.python.org/sigs/

Python Success Stories--from air-traffic control to on-line
match-making--can inspire you or decision-makers to whom you're
subject with a vision of what the language makes practical.
http://www.pythonology.com/success

The Python Software Foundation (PSF) has replaced the Python
Consortium as an independent nexus of activity. It has official
responsibility for Python's development and maintenance.
http://www.python.org/psf/
Among the ways you can support PSF is with a donation.
http://www.python.org/psf/donations/

The Summary of Python Tracker Issues is an automatically generated
report summarizing new bugs, closed ones, and patch submissions.
http://search.gmane.org/[email protected]&group=gmane.comp.python.devel&sort=date

Although unmaintained since 2002, the Cetus collection of Python
hyperlinks retains a few gems.
http://www.cetus-links.org/oo_python.html

Python FAQTS
http://python.faqts.com/

The Cookbook is a collaborative effort to capture useful and
interesting recipes.
http://code.activestate.com/recipes/langs/python/

Many Python conferences around the world are in preparation.
Watch this space for links to them.

Among several Python-oriented RSS/RDF feeds available, see:
http://www.python.org/channews.rdf
For more, see:
http://www.syndic8.com/feedlist.php?ShowMatch=python&ShowStatus=all
The old Python "To-Do List" now lives principally in a
SourceForge reincarnation.
http://sourceforge.net/tracker/?atid=355470&group_id=5470&func=browse
http://www.python.org/dev/peps/pep-0042/

del.icio.us presents an intriguing approach to reference commentary.
It already aggregates quite a bit of Python intelligence.
http://del.icio.us/tag/python

*Py: the Journal of the Python Language*
http://www.pyzine.com

Dr.Dobb's Portal is another source of Python news and articles:
http://www.ddj.com/TechSearch/searchResults.jhtml?queryText=python
and Python articles regularly appear at IBM DeveloperWorks:
http://www.ibm.com/developerworks/s...rchScope=dW&encodedQuery=python&rankprofile=8

Previous - (U)se the (R)esource, (L)uke! - messages are listed here:
http://search.gmane.org/?query=pyth...nks&group=gmane.comp.python.general&sort=date
http://groups.google.com/groups/search?q=Python-URL!+group:comp.lang.python&start=0&scoring=d&
http://lwn.net/Search/DoSearch?words=python-url&ctype3=yes&cat_25=yes

There is *not* an RSS for "Python-URL!"--at least not yet. Arguments
for and against are occasionally entertained.


Suggestions/corrections for next week's posting are always welcome.
E-mail to <[email protected]> should get through.

To receive a new issue of this posting in e-mail each Monday morning
(approximately), ask <[email protected]> to subscribe. Mention
"Python-URL!". Write to the same address to unsubscribe.


-- The Python-URL! Team--

Phaseit, Inc. (http://phaseit.net) is pleased to participate in and
sponsor the "Python-URL!" project. Watch this space for upcoming
news about posting archives.
 
R

rurpy

Candidate to *Longest and Most Boring Thread of the Year* - started
more than a month ago, currently discussing "The official definition
of call-by-value", and "What't the value of an object":
http://groups.google.com/group/comp.lang.python/t/6163956596a8c082/

Nice. The Python Reference defines objects, the core concept
of Python, as id, type, and value, and then leaves one clueless
about what a value is, and several notable Python contributors
declare the subject boring.

I guess this goes a long way to explaining why the Python docs
suck so badly in many areas.
 
F

Francesco Guerrieri

Nice. The Python Reference defines objects, the core concept
of Python, as id, type, and value, and then leaves one clueless
about what a value is, and several notable Python contributors
declare the subject boring.

I guess this goes a long way to explaining why the Python docs
suck so badly in many areas.

This is a commonly heard assertion.
Maybe it's just me but I find that on average Python documentation on
the web is pretty good (*) and does its job very well.
One is also left to wonder why all these critics don't take some
initiative and work to improve it.

Francesco
(*) Not to mention many books, papers, and magazines, like those by
Alex Martelli, Mark Lutz, Mark Hammond and many others.
 
G

George Sakkis

Nice.  The Python Reference defines objects, the core concept
of Python, as id, type, and value, and then leaves one clueless
about what a value is, and several notable Python contributors
declare the subject boring.

I guess this goes a long way to explaining why the Python docs
suck so badly in many areas.

No, this goes a long way to explain why you don't need a PhD in
denotational semantics or ontology to use Python effectively. The
current discussion on that thread may be interesting to language
lawyers and philosophers but it's pretty much irrelevant in
understanding how Python works.

George
 
G

Gabriel Genellina

Nice. The Python Reference defines objects, the core concept
of Python, as id, type, and value, and then leaves one clueless
about what a value is, and several notable Python contributors
declare the subject boring.

The C99 language standard does not define what "memory" is, even if many
parts on the language definition rely on how memory actually works. This
has not prevented programmers from writing good C code.

Arithmetic (and algebra) was developed way before mathematicians could
give a good definition of what a "number" really is.

I don't feel anybody would improve their Python skills chasing what the
"value" of an object is, least to make contortions so some arbitrary
definition of "call by value" be applicable to the language. It's a boring
topic for *ME* and the above "Most Boring Thread" is just *MY* opinion; if
you or anyone else enjoy the discussion or consider it important in some
way, of course you're all free to continue as long as you wish.

BTW, I think some other thread got a few more than 300 posts, so this
one -currently at 268- still has a chance to get the first prize as
Longest Thread - but you'll have to write hard :)
I guess this goes a long way to explaining why the Python docs
suck so badly in many areas.

I don't think so, anyway, I guess the usual reply is "all contributions
are welcome".
 
J

Joe Strout

I don't feel anybody would improve their Python skills chasing what
the "value" of an object is, least to make contortions so some
arbitrary definition of "call by value" be applicable to the language.

Actually, contortions are required to make the standard definition of
"call by value" NOT be applicable to Python as well as all other
modern OOP languages [1].

Maybe we can discuss it further, and make this thread about the thread
longer than the thread it's about?

Cheers,
- Joe

[1] http://www.strout.net/info/coding/valref/
 
R

rurpy

The C99 language standard does not define what "memory" is, even if many
parts on the language definition rely on how memory actually works. This
has not prevented programmers from writing good C code.

Do you really want to compare the C standard to the
Python Reference in the context of document quality?
I haven't looked at it in years but my recollection
is that even 15 years ago it was orders of magnitude
more detailed and specific than the Python Reference.

Secondly, "memory", "computer", "electricity" are all
obviously outside the scope of a language definition.
The nature of a concept that is the central concept
in the language is equally obviously in scope. I am
amazed at the lengths some people here will go to
defend problems in Python, even turning them into
virtues. Why not just say, "yea, well it needs work
but <insert favorite apologetics here>"?

Thirdly, the question is not about, "*can* you use it?".
Obviously people make use of lots of software with much
worse docs that the Python Docs. The questions is about
"is it complete and accurate?", and "can I get the
information I need to understand/use Python from it
effectively?" (Those are not yes/no questions.)
Arithmetic (and algebra) was developed way before mathematicians could
give a good definition of what a "number" really is.

That didn't stop them from at least trying. And
there was Euclid's approach which was fairly rigorous
for the times.
I don't feel anybody would improve their Python skills chasing what the
"value" of an object is, least to make contortions so some arbitrary
definition of "call by value" be applicable to the language.

And I feel you're wrong. The reason I am interested
in the definition of an object stems from a very early
experience with Python. Not fully getting what an
object was, I decided to write an "examine" function
to printout everything that could be found out about
an object. I printed the id, then all the attributes.
But they all turned out to be objects so I examine()'d
them recursively (and quickly discovered the need for
a depth limit.) Then I tried to print the 3rd aspect,
it's value, and ran smack into the issues you find so
boring.

Also if you hadn't been so bored and had actually
read the most recent postings you would have
discovered I made absolutely no mention at all of
call-by-anything, let alone tried to contort anything.
I was *asking* what "value" meant in context of the
P.L.R. and floating some possible proto-definitions
based on what I learned. Sheesh!
It's a boring
topic for *ME* and the above "Most Boring Thread" is just *MY* opinion; if
you or anyone else enjoy the discussion or consider it important in some
way, of course you're all free to continue as long as you wish.

Oh come on, that's pretty disingenuous. The weekly
Python News is not exactly lil'ole Gabriel posting
an opinion to c.l.p. But since it is your opinion,
I sure you won't mind me responding with mine.
BTW, I think some other thread got a few more than 300 posts, so this
one -currently at 268- still has a chance to get the first prize as
Longest Thread - but you'll have to write hard :)

I had no intention of writing anything else until
you responded. Maybe we can do it together!!
I don't think so, anyway, I guess the usual reply is "all contributions
are welcome".

One of the reasons I would like to formulate a good
model of an object's value and type is so that I could
try to offer something better. Responses like yours
are significantly demotivating.
 
G

Gabriel Genellina

I don't feel anybody would improve their Python skills chasing what
the "value" of an object is, least to make contortions so some
arbitrary definition of "call by value" be applicable to the language.

Actually, contortions are required to make the standard definition of
"call by value" NOT be applicable to Python as well as all other modern
OOP languages [1].

Maybe we can discuss it further, and make this thread about the thread
longer than the thread it's about?

Mmm, don't count on *my* followups to beat the record! :)
 
R

rurpy

No, this goes a long way to explain why you don't need a PhD in
denotational semantics or ontology to use Python effectively. The
current discussion on that thread may be interesting to language
lawyers and philosophers but it's pretty much irrelevant in
understanding how Python works.

People use lots of things without understanding
them in detail. That doesn't mean that it doesn't
matter if the Python Docs don't explain for
programmer's what an object is (I agree there
is no need to describe it in terms of denotational
semantics or ontology). There are people who
would like to form a reliable mental model of
how Python works by reading docs rather than
by synthesizing an lot of experiences, mistakes,
and experiences into that model.

I'll grant you that one needed worry too much
about what the value of an object is, relative
to innumerably discussed nature of assignment,
default argument values, and such, but I think
it is important for a full understanding of
how Python works.

And I emphatically disagree that this is only
of interest to language lawyers -- they already
know how Python works. It is people like me
that need the information.
 
R

rurpy

This is a commonly heard assertion.
Maybe it's just me but I find that on average Python documentation on
the web is pretty good (*) and does its job very well.

"Good" is a subjective word. And actually I too
think they are pretty good, at least relative to
the quality of many free software projects. But
Python is a very high quality language (albeit
with a few quirks) and the quality of the docs
really doesn't rise to the quality of the language.

The discussion here and in part of the longest
most boring thread was caused by the lack of a
decent description of Python objects. The 2.6
docs say coverage of new-style classes is still
incomplete although it appears better than in 2.5.

Besides missing information much text appears to
have been written by people in a contest to see
who could describe something in the fewest possible
words and still defend it as arguably correct.
One really needs to keep the end goal in mind --
transmittal of the information to the reader.

The organization is still bizarre, with the
*builtin* types and functions documented in the
Library(!) manual rather that Language Manual
where one would expect them (in that I hardly
think you could have a Python language implementation
without a int type or a list type.) One would
think the Library Manual would describe the
modules that were not-essential to the core
Python.

And then there are lots of little things like
the comment in the description of the packages
in import statement: "XXX: Can't be bothered to
spell this out right now", with a url to a
description of packages in Python 1.5. (From
the Python 2.5 docs, haven't installed 2.6 yet.)
How would you feel if you bought a book and read
that in it?

But to see the difference between the Python Docs
and "good" documentation, take a look at something
like David Beasley's "Essential Python". It is
not perfect either of course (among other things
it copies nearly verbatim the incomplete Python
Doc definition of "object") and it is not intended
to define the language, but the organization and
clarity of writing is way better than the Python
Docs.

When you look at the the details of the individual
modules, there is a nearly infinite list of minor
to moderate problems.

All that being said, the docs are slowly getting
better over time, and the people working on them
certainly deserve thanks and appreciation for the
hard work that has gone into them.
One is also left to wonder why all these critics don't take some
initiative and work to improve it.

What makes you think that all of them don't?
 
G

Gabriel Genellina

Do you really want to compare the C standard to the
Python Reference in the context of document quality?
I haven't looked at it in years but my recollection
is that even 15 years ago it was orders of magnitude
more detailed and specific than the Python Reference.

Sure it is. Thanks to such details Python can be successfully compiled on
many platforms. But they still leave some details unspecified, like what
exactly means "to store a value". You can't specify everything - sometimes
even on purpose so different implementations are free to choose whichever
alternative fits best.
Secondly, "memory", "computer", "electricity" are all
obviously outside the scope of a language definition.
The nature of a concept that is the central concept
in the language is equally obviously in scope. I am
amazed at the lengths some people here will go to
defend problems in Python, even turning them into
virtues. Why not just say, "yea, well it needs work
but <insert favorite apologetics here>"?

Yes, sure. I don't know how old that Python definition of object is (I
mean, the page that says "identity+type+value"), but in particular, I
would not have used the term "value" there. "state" is more broadly used,
and less confusing. The word "value" as used in that generic description
has a different meaning that the same term as used in "call by value" and
"the value of an expression".
Thirdly, the question is not about, "*can* you use it?".
Obviously people make use of lots of software with much
worse docs that the Python Docs. The questions is about
"is it complete and accurate?", and "can I get the
information I need to understand/use Python from it
effectively?" (Those are not yes/no questions.)

Certainly the docs have to be improved. But some details, although
refering to fundamental concepts, are not so important in order to
understand the language or effectively use it.
(Uh, I hate to use another mathematical example). Most people that know
about trigonometric functions like sin and cos use them without much
consideration. They exist and are well defined; sin is (oposite
side)/(hypotenuse) by example. One can do a lot of work in trigonometry
based on those definitions; and probably *most* work in trigonometry was
developed before a rigurous definition of the sin function could even be
expressed. Because the above geometric definition cannot satisfy a
mathematician: he wants an expression he can work with and study its
properties (and had to wait until concepts like limit, series, infinite
were available). But from a practical POV, the naïve geometric definition
is more than enough to do any useful work.
Back to Python, I think a precise definition of "value" (or better
"state") isn't required to effectively use the language. The simple
concept of "whatever information the object carries with itself" should be
enough to understand it, I presume. And perhaps a few examples explaining
it would be in order...
And I feel you're wrong. The reason I am interested
in the definition of an object stems from a very early
experience with Python. Not fully getting what an
object was, I decided to write an "examine" function
to printout everything that could be found out about
an object. I printed the id, then all the attributes.
But they all turned out to be objects so I examine()'d
them recursively (and quickly discovered the need for
a depth limit.) Then I tried to print the 3rd aspect,
it's value, and ran smack into the issues you find so
boring.

I'm sure you learned a lot more from your experiments than reading an
academic and precise definition of "value" in a perfect document...
Also if you hadn't been so bored and had actually
read the most recent postings you would have
discovered I made absolutely no mention at all of
call-by-anything, let alone tried to contort anything.
I was *asking* what "value" meant in context of the
P.L.R. and floating some possible proto-definitions
based on what I learned. Sheesh!

Note that the summary was based on all messages posted last week - there
were three subthreads spawned from the original one, of which I choose to
mention two. I was not specifically talking about your posts, nor anybody
in particular.
A little story: A long time ago a friend of mine got a multi effects pedal
for his guitar. He was really excited showing me his new acquisition.
"Hear! Hall reverb!" (chord played). "Hear! Church reverb now!" (same
chord played; more reverb). After hearing a few dozen different settings,
I didn't care if the damn thing made the most beautiful chorus effect in
the world: I was just bored to death! And that had nothing to do with his
playing skills (muuuuch higher than mine, btw!), nor the box.
Oh come on, that's pretty disingenuous. The weekly
Python News is not exactly lil'ole Gabriel posting
an opinion to c.l.p. But since it is your opinion,
I sure you won't mind me responding with mine.

Yes, it *was* just my opinion, like everything else I write. I didn't mean
to dismiss your posts (or anyone else's) at all. It was just a comment -
and looks like I'll have to avoid those in the future...
I had no intention of writing anything else until
you responded. Maybe we can do it together!!

Uhm, don't count on my replies to reach the first position! :)
One of the reasons I would like to formulate a good
model of an object's value and type is so that I could
try to offer something better. Responses like yours
are significantly demotivating.

Sorry, that was not the intent at all!!!
 
S

Steve Holden

One of the reasons I would like to formulate a good
model of an object's value and type is so that I could
try to offer something better. Responses like yours
are significantly demotivating.

And yet you argue when people try to explain to you that objects don't
*have* values, objects *are* values. Objects have attributes, which are
references to other values. One of an object's attributes is its type.

You seem to be hunting for the ineffable "primitive value" that has no
other attributes. Such a thing doesn't exist.
['__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__']['__base__', '__bases__', '__basicsize__', '__call__', '__class__',
'__cmp__', '__delattr__', '__dict__', '__dictoffset__', '__doc__',
'__flags__', '__getattribute__', '__hash__', '__init__', '__itemsize__',
'__module__', '__mro__', '__name__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__subclasses__',
'__weakrefoffset__', 'mro']
regards
Steve
 
R

rurpy

(e-mail address removed) wrote:

[...]
One of the reasons I would like to formulate a good
model of an object's value and type is so that I could
try to offer something better. Responses like yours
are significantly demotivating.

And yet you argue when people try to explain to you that objects don't
*have* values, objects *are* values. Objects have attributes, which are
references to other values. One of an object's attributes is its type.
[...]

Steve, since Gabriel does not want to go for the
record in this thread :), I posted my response as
a reply to your most recent message in the "Official
definition of call-by-value..." thread.
 
D

Daniel Fetchinson

One of the reasons I would like to formulate a good
And yet you argue when people try to explain to you that objects don't
*have* values, objects *are* values. Objects have attributes, which are
references to other values. One of an object's attributes is its type.
[...]

Steve, since Gabriel does not want to go for the
record in this thread :), I posted my response as
a reply to your most recent message in the "Official
definition of call-by-value..." thread.

And this thread has a good chance of becoming the "Longest and Most
Boring Python-URL Weekly Python News and Links Thread".

Cheers,
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,888
Messages
2,569,964
Members
46,293
Latest member
BonnieHamb

Latest Threads

Top