f



Python's and and Pythons or

I really like the logic that Pythons "or" is not only short-circuit but non-typed.

So I can say

y = override or default

and y won't necc be True or False. If override boolean evaluates to True (which, for most classes, means not None) than y will be equal to override. Otherwise it will be equal to default.

I have two questions
--> Is there a handy name for this type of conditional (something as catchy as "short circuit or")

and 

--> Is there a common idiom for taking advantage of the similar behavior of "and". The "override or default" just makes me grin every time I use it.

Thanks
0
10/9/2013 11:54:03 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

11 Replies
745 Views

Similar Articles

[PageSpeed] 2

On Wed, 09 Oct 2013 16:54:03 -0700, Peter Cacioppi wrote:

> I really like the logic that Pythons "or" is not only short-circuit but
> non-typed.
> 
> So I can say
> 
> y = override or default
> 
> and y won't necc be True or False. If override boolean evaluates to True
> (which, for most classes, means not None) than y will be equal to
> override. Otherwise it will be equal to default.
> 
> I have two questions
> --> Is there a handy name for this type of conditional (something as
> catchy as "short circuit or")

I don't know about catchy. I think of it as just a special case of duck-
typing -- all objects can be duck-typed as if they were bools.

Some terms that are often used:

"boolean context"
"truth context"
"truthiness"

The values themselves are described as "truthy" and "falsey", or "true-
like" and "false-like", or even just "true and false" (as opposed to True 
and False). Other languages (Ruby, PHP, Javascript, etc.) also have 
truthy and falsey values, but in my opinion none of them have got it 
right. Python has a unifying model of truthiness: objects which represent 
"something" ought to be truthy, those which represent "nothing" ought to 
be falsey:


# Nothing
empty strings '', u''
empty list, tuple, dict [] () {}
empty set, frozenset
None
zero 0, 0.0, 0j, Decimal("0.0"), Fraction(0)
any empty collection or mapping


# Something
all other strings
all non-empty lists, tuples, dicts
all non-empty sets, frozensets
object()
all non-zero numbers
any non-empty collection or mapping
anything else (by default)


while other languages appear to just have a grab-bag of whatever 
arbitrary values the language designer thought ought to be truthy/falsey.



> and
> 
> --> Is there a common idiom for taking advantage of the similar behavior
> of "and". The "override or default" just makes me grin every time I use
> it.


Not that I can think of.



-- 
Steven
0
10/10/2013 12:36:20 AM
On Thu, Oct 10, 2013 at 11:36 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Other languages (Ruby, PHP, Javascript, etc.) also have
> truthy and falsey values, but in my opinion none of them have got it
> right. Python has a unifying model of truthiness: objects which represent
> "something" ought to be truthy, those which represent "nothing" ought to
> be falsey

Python's model makes a lot of sense. The only other system that I've
seen that makes as much sense is Pike's, which can be summarized as:

Falsey:
0 (the integer; does the job of None in many contexts)

Truthy:
Everything else.

Python lets you distinguish easily between an empty list and a list
with something in it; Pike lets you distinguish between a list and the
absence of a list.

The use of 'and' and 'or' in returning their arguments is an extremely
useful one, but I'm not sure it has a name. Pike and Lua have the same
behaviour; neither offers a good term for it. Recommendation: Invent a
term if you can't find one, and start using it. :)

ChrisA
0
rosuav (4324)
10/10/2013 1:13:54 AM
On Wednesday, October 9, 2013 4:54:03 PM UTC-7, Peter Cacioppi wrote:
> I really like the logic that Pythons "or" is not only short-circuit but non-typed.
> 
> 
> 
> So I can say
> 
> 
> 
> y = override or default
> 
> 
> 
> and y won't necc be True or False. If override boolean evaluates to True (which, for most classes, means not None) than y will be equal to override. Otherwise it will be equal to default.
> 
> 
> 
> I have two questions
> 
> --> Is there a handy name for this type of conditional (something as catchy as "short circuit or")
> 
> 
> 
> and 
> 
> 
> 
> --> Is there a common idiom for taking advantage of the similar behavior of "and". The "override or default" just makes me grin every time I use it.
> 
> 
> 
> Thanks

ok, since someone asked, I suggest we call the "return it's arguments" behavior "echo-argument".

That is to say, the reason we can write 

y = override or default 

is because Python implements echo-argument or. That is to say, "or" doesn't necc return True or False, "or" returns the first "truthy" argument it encounters. 

"and" behaves similarly, in that it returns the first "falsey" argument it encounters.

I'm trying to think of a good example usage of echo-argument and. Maybe something like

possible = foo and foo.allowsit()
if (possible is None) :
   print "foo not provided"
if (possible is False) :
   print "foo doesn't allow it"

A bit awkward, echo-argument or is more naturally useful to me then echo-argument and.



0
10/10/2013 6:12:49 AM
On Thu, Oct 10, 2013 at 5:12 PM, Peter Cacioppi
<peter.cacioppi@gmail.com> wrote:
> I'm trying to think of a good example usage of echo-argument and. Maybe something like
>
> possible = foo and foo.allowsit()
> if (possible is None) :
>    print "foo not provided"
> if (possible is False) :
>    print "foo doesn't allow it"
>
> A bit awkward, echo-argument or is more naturally useful to me then echo-argument and.

first_element = some_list[0]    # Oops, may crash

try:
    first_element = some_list[0]
except IndexError:
    firstelement = None   # A bit verbose

first_element = some_list and some_list[0]

# or if you want a zero instead of an empty list:
first_element = len(some_list) and some_list[0]


Also, consider the case where you have a function, or None:

result = func(*args,**kwargs)   # NoneType is not callable

result = func and func(*args,**kwargs)

ChrisA
0
rosuav (4324)
10/10/2013 6:45:49 AM
On 10/09/2013 11:12 PM, Peter Cacioppi wrote:
>
> I'm trying to think of a good example usage of echo-argument and. Maybe something like
>
> possible = foo and foo.allowsit()
> if (possible is None) :
>     print "foo not provided"
> if (possible is False) :
>     print "foo doesn't allow it"
>
> A bit awkward, echo-argument or is more naturally useful to me then echo-argument and.

It's used as a guard:

     if some_list and some_list[0] == something_or_other:
          do some_work()

Without the 'some_list and' portion when some_list was either empty or, say, None, the some_list[0] would fail with an 
error (IndexError, TypeError, etc.).

--
~Ethan~
0
ethan7978 (844)
10/10/2013 6:46:55 AM
On Wednesday, October 9, 2013 4:54:03 PM UTC-7, Peter Cacioppi wrote:
> I really like the logic that Pythons "or" is not only short-circuit but non-typed.
> 
> 
> 
> So I can say
> 
> 
> 
> y = override or default
> 
> 
> 
> and y won't necc be True or False. If override boolean evaluates to True (which, for most classes, means not None) than y will be equal to override. Otherwise it will be equal to default.
> 
> 
> 
> I have two questions
> 
> --> Is there a handy name for this type of conditional (something as catchy as "short circuit or")
> 
> 
> 
> and 
> 
> 
> 
> --> Is there a common idiom for taking advantage of the similar behavior of "and". The "override or default" just makes me grin every time I use it.
> 
> 
> 
> Thanks

So you can wrap it all up in one big example

y = (overrideprovider and overrideprovdider() ) or default

echo-argument and/or is a beautiful thing

0
10/10/2013 6:55:50 AM
On 10/10/2013 2:45 AM, Chris Angelico wrote:
> On Thu, Oct 10, 2013 at 5:12 PM, Peter Cacioppi
> <peter.cacioppi@gmail.com> wrote:
>> I'm trying to think of a good example usage of echo-argument and. Maybe something like

>> A bit awkward, echo-argument or is more naturally useful to me then echo-argument and.
>
> first_element = some_list[0]    # Oops, may crash

some_list[0:1] always works, and sometimes is usable, but you still 
cannot index the slice.

> try:
>      first_element = some_list[0]
> except IndexError:
>      firstelement = None   # A bit verbose
>
> first_element = some_list and some_list[0]
>
> # or if you want a zero instead of an empty list:
> first_element = len(some_list) and some_list[0]
>
>
> Also, consider the case where you have a function, or None:
>
> result = func(*args,**kwargs)   # NoneType is not callable
>
> result = func and func(*args,**kwargs)

y = x and 1/x
One just has to remember that y==0 effectively means y==+-infinity ;-).

-- 
Terry Jan Reedy

0
tjreedy (5460)
10/10/2013 7:43:15 AM
On Thu, Oct 10, 2013 at 6:43 PM, Terry Reedy <tjreedy@udel.edu> wrote:
> y = x and 1/x
> One just has to remember that y==0 effectively means y==+-infinity ;-).

Good example. Extremely appropriate to situations where you're showing
a set of figures and their average:

Foo   1
Bar   3
Quux  7
Asdf  9
===== 5

Let the average show as zero if there are none, it won't hurt:

print("=====",count and total/count)

ChrisA
0
rosuav (4324)
10/10/2013 8:03:01 AM
On 10/10/2013 12:43 AM, Terry Reedy wrote:
> On 10/10/2013 2:45 AM, Chris Angelico wrote:
>> On Thu, Oct 10, 2013 at 5:12 PM, Peter Cacioppi
>> <peter.cacioppi@gmail.com> wrote:
>>> I'm trying to think of a good example usage of echo-argument and. Maybe something like
>
>>> A bit awkward, echo-argument or is more naturally useful to me then echo-argument and.
>>
>> first_element = some_list[0]    # Oops, may crash
>
> some_list[0:1] always works, and sometimes is usable, but you still cannot index the slice.

Not if some_list is None, False, or another non-indexable type.

--
~Ethan~
0
ethan7978 (844)
10/10/2013 1:33:31 PM
On 10/10/2013 9:33 AM, Ethan Furman wrote:

> On 10/10/2013 12:43 AM, Terry Reedy wrote:

>> On 10/10/2013 2:45 AM, Chris Angelico wrote:
>>> first_element = some_list[0]    # Oops, may crash

>> some_list[0:1] always works, and sometimes is usable, but you still
>> cannot index the slice.

> Not if some_list is None, False, or another non-indexable type.

Did you really not understand that some_list is intended to be a list? 
Just like my_string, for instance, would be a string? Chris's statement 
further specifies some_list as a list that is expected to not be empty, 
but might be -- so one has to guard against the possibility.

The trick of slicing instead of indexing in this context is not obvious 
to everyone learning Python. Most other languages only have indexing. I 
learned the trick years ago when someone posted it on this list.

-- 
Terry Jan Reedy

0
tjreedy (5460)
10/11/2013 1:41:04 AM
On 10/10/2013 06:41 PM, Terry Reedy wrote:
> On 10/10/2013 9:33 AM, Ethan Furman wrote:
>
>> On 10/10/2013 12:43 AM, Terry Reedy wrote:
>
>>> On 10/10/2013 2:45 AM, Chris Angelico wrote:
>>>> first_element = some_list[0]    # Oops, may crash
>
>>> some_list[0:1] always works, and sometimes is usable, but you still
>>> cannot index the slice.
>
>> Not if some_list is None, False, or another non-indexable type.
>
> Did you really not understand that some_list is intended to be a list? Just like my_string, for instance, would be a
> string? Chris's statement further specifies some_list as a list that is expected to not be empty, but might be -- so one
> has to guard against the possibility.

I understood it just fine.  I'm also aware that at some point, in some program, it will be None (and it won't be a bug ;).


> The trick of slicing instead of indexing in this context is not obvious to everyone learning Python. Most other
> languages only have indexing. I learned the trick years ago when someone posted it on this list.

It's a good trick, I use it myself.

--
~Ethan~
0
ethan7978 (844)
10/11/2013 2:47:02 AM
Reply:

Similar Artilces:

python is a python
python is a python ...

When Python *Eggs* better than Python *distutils*?? What's Eggs?
I have been using distuils for a while and was wondering when Python Eggs (new project) is better? So basically Python Eggs precompiles and compresses binaries for you so you just have to load it to run your app? Chris "seberino@spawar.navy.mil" <seberino@spawar.navy.mil> writes: > I have been using distuils for a while and was wondering when Python > Eggs (new project) is better? Python Eggs, and the 'setuptools' package, are still new, so they're not yet a core part of Python. "The primary benefits of Python Eggs are: * They enable tools...

Python's __getattr__, Perl's autoload, Ruby's method_missing, and Smalltalk's #doesNotUnderstand
I'm still new here, and I just completed reading CLTL's documentation on packages and On Lisp's documentation on CLOS. It doesn't appear that Lisp has the equivalent of Python's __getattr__, Perl's autoload, Ruby's method_missing, and Smalltalk's #doesNotUnderstand. That is, there is no way I can do this (without new-function being defined): (new-function) and have it call some other function like this: (missing-symbol 'new-function) whose returning value will be evaluated as the value of new-function. Or did I miss something? Jonathan Gardner <...

Python C extension providing... Python's own API?
Does anyone know if it would be possible to create a CPython extension -- or use the ctypes module -- to access Python's own embedding API (http://docs.python.org/api/initialization.html &c.)? Could a Python program itself create a sub-interpreter, and work with it with all the privileges and capabilities that an actual C program would have? I realize that this may be a bit too... mystical? ... for a lot of people's tastes, but I'm just curious if it's possible. :) On Mar 26, 12:21 pm, "Adam Atlas" <a...@atlas.st> wrote: > Does anyone know if it would ...

So, what's the real story on Python 2 vs Python 3?
The Python.org site says that the future is Python 3, yet whenever I try something new in Python, such as Tkinter which I am learning now, everything seems to default to Python 2. By this I mean that, whenever I find that I need to install another package, it shows up as Python 2 unless I explicitly specify Python 3. What's the deal? If I want to make a distributable software package, should it be 2 or 3? Enquiring minds want to know. In article <XT7vu.64127$Qi4.25759@fx11.iad>, Travis McGee <nobody@nowhere.com> wrote: > The Python.org site says that the ...

RE: Python's garbage collection was Re: Python reliability
Tom Anderson wrote: > Except that in smalltalk, this isn't true: in ST, every variable > *appears* to contain a reference to an object, but implementations > may not actually work like that. In particular, SmallTalk 80 (and > some earlier smalltalks, and all subsequent smalltalks, i think) > handles small integers (those that fit in wordsize-1 bits) > differently: all variables contain a word, whose bottom bit is a tag > bit; if it's one, the word is a genuine reference, and if it's zero, > the top bits of the word contain a signed integer. This type of im...

The Python's regex different from Perl's ,I want know what's the different?
The Python's regex different from Perl's ,I want know what's the different? > The Python's regex different from Perl's ,I want know what's the > different? Easy: bash$ diff <(lynx -dump http://perldoc.perl.org/perlre.html) <(lynx -dump http://docs.python.org/library/re.html) Had you tried the great Google in the sky, you might have found such pages as: http://mail.python.org/pipermail/python-list/2005-April/319030.html or even a popular book on the subject: http://oreilly.com/catalog/9780596002893/ -tkc The regular expression syntax is ...

Invoking Python from Python
Hi all, I have a need to create a Python script on the fly from another Python program and then execute the script so created. Do I need to invoke Python through os.spawnl or is there a better way? Thanks, -- John Am Tue, 08 Nov 2005 08:10:25 -0800 schrieb John Henry: > Hi all, > > I have a need to create a Python script on the fly from another Python > program and then execute the script so created. Do I need to invoke > Python through os.spawnl or is there a better way? Hi, creating source code with a script, is no good solution. Once I had to maintain lisp code which stored its data in lisp code, too (incl. conditions and loops). It was a nightmare. Please explain what you want to do, and we will find a better solution. HTH, Thomas -- Thomas Gļæ½ttler, http://www.thomas-guettler.de/ E-Mail: guettli (*) thomas-guettler + de Spam Catcher: niemand.leermann@thomas-guettler.de In article <pan.2005.11.08.16.21.11.472836@thomas-guettler.de>, Thomas Guettler <niemand.leermann@thomas-guettler.de> wrote: . . . >creating source code with a script, is no good solution. > >Once I had to maintain lisp code which stored its data in lisp code, too >(incl. conditions and loops). It was a nightmare. > >Please explain what you want to do, and we will find a better solution. . . . Yes and no. There are times when it's justified. I ENTIRELY agree, though, that many people who *think* that's what they...

Python mascot? How about a Pythoneer?
I've been thinking that a good Python mascot might help in raising public awareness of Python. The problem with a snake as a mascot is that it is not anthropomorphic enough. An effective mascot has to have something approximating two arms, two legs, and a head, so that he can be put into various interesting situations and adventures. (At the very least, he has to be able to work a keyboard and a mouse!) Good examples can be found in some of the imaginative things that have been done with Linux's Tux. So a snake is out. So are Terry Gilliam's wonderful cartoons for the Flyin...

Regular Toronto Python User's Group meeting: Using CouchDB from Python
This month we're going to have a presentation from Myles Braithwaite on how to use the CouchDB system from Python. According to Myles this is the stuff he couldn't get to when he presented the library at TLUG last month. CouchDB is an Erlang-coded distributed "document oriented" database with bi-directional replication mechanisms. There is a Python API and Myles will be discussing how you go about actually using CouchDB in your projects (hopefully he'll cover the "why you'd want to do that" stuff too :) ). We'll meet at Linux Caffe, at the corner of Harbord and Grace, one block South of Christie station, at 7:00pm. We'll start the formal presentation at 7:15. Directions are available on the website's next-meeting page: http://www.pygta.org Have fun all, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com ...

Python to Python communication
Hello, I have a group of Python programms which I want to teach to "talk to each other". All run on Windows, on the same computer or in the same intranet. Security of communication is not an issue (encryption on lower level protocols / intra computer communication). Partially these programs are using wxPython. It is important that the communcation is "only an added feature", I am not willing to spend big memory / computing ressources on it. So I googled and came up with at least the following opportunities: XMLRPC - quite "simple" to implement within python, contained in my favourite web framework Quixote / medusa SOAP - around the same amount of work as XMLRPC ----> these two are fully buzzword compatible to enterprise communication needs. But are they really lightwight and needed? Banana - within the twisted framework. Is described as high performance with very litte ressources. From my scanning of twisted it is meanwhile possible to integrate it within wxPython and you only need to sell the soul of your firstborn for it; but I got the impression twisted rather needs a total commitment than a "I just need some banana, man" pyro - Python Remote Objects. Irmen de Jong has a "get Firefox" icon on it's page and he plays with the name "pyro", which makes a good impression. It looks rather "ripe", but: he is talking about "pyro 4.0" which will be incompatible with pyro ...

Your Million Dollar Python Project at the Toronto Python User's Group on Tuesday
We'll be having our regular Toronto Python User's Group (PyGTA) at our regular location, Linux Caffe, at our regular time, 7pm on the Third Tuesday of the month. This month's topic is: If you had up to 1 million dollars to spend on a Python project, what would you spend it on? What features would you like to see? What changes do you feel need to be made? Would you spend the money on advertising, optimization, libraries, frameworks, concurrency, alternative implementations, or infrastructure? What keeps you from using Python everywhere, and what could you do to fix that? Would you spend the money on making a killer commercial project? Would you hire programmers, put out code bounties, or just donate money to projects? Linux Caffe is located at the corner of Grace and Harbord, one block South of Christie station, details on the web-site at http://www.pygta.org. Have fun, Mike -- ________________________________________________ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com ...

Embedding Python in Python
Hi, I've been programming in Python for a couple of weeks now and am quite impressed with the language - it was very easy to learn (it actually reminds me a lot of programming in BASIC many many years ago - it's very fast to hack together a couple lines of code in interactive mode). I'm throwing together a simple little game (sort of a MUD-type thing) as my first 'big' project, and I thought it would be cool to be able to script the game in Python. Basically, I want to be able to type scripts in from within the game and attach them to objects, monsters, rooms, whatever. N...

Dr. Dobb's Python-URL!
QOTW: "Generally, you should always go for whatever is clearest/most easily read (not just in Python, but in all languages)." - Timothy Delaney "You will find as your programming experience increases that the different languages you learn are appropriate for different purposes, and have different advantages and disadvantages. Python excels at expressing algorithms in an unambiguous and easily-readable way." - Steve Holden Is Python a viable extension language for Java? Ravi Teja expertly outlines the possibilities: http://groups.google.com/group/comp....

Dr. Dobb's Python-URL!
QOTW: "A good rule of thumb is: The less non-python stuff you have around, the better. Non-python parts of any given system are invariably the ones causing most of the problems :-)." --Ville Vainio "The Language Reference [http://www.python.org/doc/current/ref/ref.html] is very readable, not excessively formal, and well worth a read." -- alan kennedy Will Stuyvesant asks how to protect his software from prying eyes when offering trial versions of commercial software. http://groups.google.com/groups?threadm=cb035744.0311030035.2ffb5e06@posting.google.com...

Dr. Dobb's Python-URL!
QOTW: "I've tried many ways over the years to represent equations legibly using Python and [it is] my experience that case sensitivity, while certainly no panacea, helps." -- Tim Hochberg "What's your pet deprecation candidate? I have always thought `backticks` as repr has got to be the most useless feature around." -- Ville Vainio Peter Hansen suggests "Imagine never having to think up variable names more complicated than 'foo'." http://groups.google.com/groups?threadm=3FB2738E.2B8C13FE@engcorp.com Patrick Maupin ad...

Dr. Dobb's Python-URL!
Editor's note: "Python-URL!" is minimal. It doesn't support advertisements, we never allow the subscribers' addresses to be used for other purposes, we don't claim infallibility, and we even take a couple weeks off some years. Occasionally, though--not as often as the US enters a shooting war, say, but more frequently than IBM hires a new CEO--we pause for a sufficiently important correction or announcement. This year, we apologize for inexplicably changing Oliver Schoenborn's name a couple of weeks ago to "Philip". Also, has anyone indexed Python bl...

Dr. Dobb's Python-URL!
QOTW: "Well, I haven't yet seen a definition of 'Integrated Development Environment' which would exclude Emacs..." - Slawomir Nowaczyk "Let me tell you: There are times when I'm really glad that as a German, I'm not supposed to possess any sense of humour at all." - Georg Brandl Pythoneers will be talking about certification for quite a while: http://tarekziade.wordpress.com/2006/10/15/marketing-python-is-urgent-part-1-a-python-certification/ http://groups.google.com/group/comp.lang.python/browse_thread/thread/60dae5ab119c4a90/ http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3SecurityEvaluation Greg Wilson's "Software Carpentry" is an important resource (even though I bristle at Greg's bad-mouthing of vi and emacs): http://www.swc.scipy.org/ The Internet Hosting Cooperative supports "any and every thing Python": http://groups.google.com/group/comp.lang.python/msg/f3c6068b873427bb Enthought Traits allow powerful GUI technique, and they're more usefully documented than many realize: http://groups.google.com/group/comp.lang.python/browse_thread/thread/90e966185e548d51/ ======================================================================== 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 ...

Dr. Dobb's Python-URL!
QOTW: "Given these criteria, my recommendations for a first programming language would be Python or Scheme." - Peter Norvig (some time ago, but referenced on comp.lang.lisp this week) http://www.norvig.com/21-days.html "however if you want more visual effect with less hassle, consider learning Python instead. with Python you can get some graphical stuff working almost out-of-the box, while with Lisp it's matter of luck if particular thing will work on your system :)." -- Alex Mizrahi (on comp.lang.lisp) http://groups.google.com/group/comp.lang.lisp/msg/7a30146ff97f79b1 Those in California get to hear what Python's "benevolent dictator" does in his day job: http://groups.google.com/group/comp.lang.python.announce/browse_frm/thread/f09ffd3e7200e06f/ ...something which isn't fully explained in the Google Master Plan: http://www.larsen-b.com/Article/246.html And for the sake of intercontinental relevance, our European pick of events has to be the Plat_Forms Web development contest in Germany: http://groups.google.com/group/pylons-discuss/browse_frm/thread/2330ada0c8e5605c/ ... although RuPy also certainly deserves attention: http://rupy.wmid.amu.edu.pl/ (November 30th is a big day: it's the Plat_Forms registration deadline *and* Guido's talk, as well as the last day of Ingeniweb in Paris, ...) "Pitivi ...

Dr. Dobb's Python-URL!
QOTW: "I'd love it if we could come up with a different term for these beasts than 'new style classes'." --Barry Warsaw "Then let me suggest ectomorphic classes, as opposed to the previous endomorphic classes. Roll-your-own classes can be called mesomorphic classes. Extension classes can be called paleomorphic classes. Then there's a precise term for each kind, and bystanders are automically informed by the very terminology used that their lives are too short to worry about the distinctions being drawn <wink>." --Tim Peters http://mail.pytho...

Dr. Dobb's Python-URL!
QOTW: "The site that I worked on spent TWO MILLION U.S. DOLLARS on its web server hardware. OK, it used Java servlets that are even slower than Python, but you have to understand that there's a point after which you can no longer pretend that hardware is free." -- Paul Rubin "Monte Carlo sampling is no way to understand code." -- Gordon McMillan Martin v. Loewis clarifies what entities might "compete" with Python http://www.google.com/groups?selm=c4sqle%24ds%2403%241%40news.t-online.com Peter Otten determines to find the simplest way of automat...

Dr. Dobb's Python-URL!
QOTW: "If we get 2.3.3c1 out in early December, we could release 2.3.3 final before the end of the year, and start 2004 with a 100% bug-free codebase <wink>." -- Tim Peters "cjOr proWe vbCould vbSettle prpFor noEnglish prpIn adjHungarian noNotation :-)" -- noPeter Jack Jensen reveals that python on mac continues as an osx option only starting with python2.4. http://mail.python.org/pipermail/python-dev/2003-November/040336.html There's an upgrade of mod_python available that addresses a potential httpd crash for both HTTP Server 2.0...

Dr. Dobb's Python-URL!
QOTW: "You can gain substantial speed-ups in very certain cases, but the main point of Pyrex is ease of wrapping, not of speeding-up." - Simon Percivall "The rule of thumb for all your Python Vs C questions is ... 1.) Choose Python by default. . . ." - Ravi Teja Do you remember Python's early (notice the mention of traversal of the World-Wide Web. All of it!) days? Guido invites your reminiscences: http://www.artima.com/forums/flat.jsp?forum=106&thread=161207 Paul Boddie wraps up the "how can I compile Python?" FAQ as authoritatively as possible (at least for the moment): http://groups.google.com/group/comp.lang.python/msg/ccdadf2b24af0f91 Nick Craig-Wood contributes a Process definition to access a Linux process table programmatically: http://groups.google.com/group/comp.lang.python/msg/61ae7c3716fa17db Embedding Python? Initialization is more subtle than first appears. Stefan Schukat explains an example which arises when working with win32: http://groups.google.com/group/comp.lang.python/msg/5cb4424ba6c8fa97 pysqlite has a create_function. Gerhard Haering illustrates its use: http://groups.google.com/group/comp.lang.python/msg/f100756cf7569e13 ======================================================================== Everything Python-related you want is probably one or two clicks away in these pages: Python.org's Python Language We...

Dr. Dobb's Python-URL!
QOTW: "...I want to reserve .var for the "with" statement (a la VB)." --Guido van Rossum "...at some point in the future Python *will* grow (optional) type declarations for all sorts of things (arguments, local variables, instanc e variables)." --Guido van Rossum The developer list responds to a request for Master Thesis ideas with a multitude of python wish lists. http://mail.python.org/pipermail/python-dev/2003-October/thread.html#39763 Marc-Andre Lemburg offers what must be the definitive answer on accessing a MS Access data...

Web resources about - Python's and and Pythons or - comp.lang.python

Resources last updated: 3/7/2016 2:31:27 PM