Python-list Digest, Vol 64, Issue 644

Chris Rebert clp2 at rebertia.com
Thu Jan 29 04:40:00 EST 2009


On Thu, Jan 29, 2009 at 1:08 AM, M Kumar <tomanishkb at gmail.com> wrote:
> is python a pure objected oriented language?

Firstly:
(A) Replying to Digests rather than individual posts is very discouraged.
(B) The proper way to start a new thread by emailing
python-list at python.org (as it says in the very header of the digest!),
not by replying to unrelated posts.

And now to your question:
Yes, Python is completely object-oriented in the Smalltalk sense;
everything is an object, there are no "primitive types" or non-object
values, in contrast to, say, Java.

Cheers,
Chris
-- 
Follow the path of the Iguana...
http://rebertia.com


> On Thu, Jan 29, 2009 at 2:08 PM, <python-list-request at python.org> wrote:
>>
>> Send Python-list mailing list submissions to
>>        python-list at python.org
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://mail.python.org/mailman/listinfo/python-list
>> or, via email, send a message with subject or body 'help' to
>>        python-list-request at python.org
>>
>> You can reach the person managing the list at
>>        python-list-owner at python.org
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Python-list digest..."
>>
>> Today's Topics:
>>
>>   1. Re: dicts,instances,containers, slotted instances, et cetera.
>>      (Michele Simionato)
>>   2. Re: Recommendation for a small web framework like Perl's
>>      CGI::Application to run as CGI? (Jeroen Ruigrok van der Werven)
>>   3. Re: Profiling Python Apps on Mac? (Robert Kern)
>>   4. Re: Results of executing hyperlink in script (Tino Wildenhain)
>>   5. Re: I'm a python addict ! (afriere at yahoo.co.uk)
>>   6. ANN: eGenix mx Base Distribution 3.1.2
>>      (eGenix Team: M.-A. Lemburg)
>>
>>
>> ---------- Forwarded message ----------
>> From: Michele Simionato <michele.simionato at gmail.com>
>> To: python-list at python.org
>> Date: Wed, 28 Jan 2009 22:17:12 -0800 (PST)
>> Subject: Re: dicts,instances,containers, slotted instances, et cetera.
>> On Jan 29, 12:23 am, ocsch... at gmail.com wrote:
>>
>> > I just find it odd that there's no quick answer on the
>> > fastest way in Python to implement a mapping in this context.
>>
>> A Python dict is as fast as you can get. If that is not enough, your
>> only choice is to try something at the C level, which may give the
>> desired speedup or not. Good luck!
>>
>>       Michele Simionato
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Jeroen Ruigrok van der Werven <asmodai at in-nomine.org>
>> To: excord80 <excord80 at gmail.com>
>> Date: Thu, 29 Jan 2009 07:31:54 +0100
>> Subject: Re: Recommendation for a small web framework like Perl's
>> CGI::Application to run as CGI?
>> -On [20090128 20:36], excord80 (excord80 at gmail.com) wrote:
>> >If that's correct, it would be great if there were a Werkzeug tutorial
>> >on deploying it for use with CGI.
>>
>> There are some real life frontends for CGI, FCGI and WSGI in Zine[1]. Look
>> in the servers directory in the repository.
>>
>> I'll double check the documentation and expand where necessary.
>>
>> [1] http://zine.pocoo.org/
>>
>> --
>> Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
>> イェルーン ラウフロック ヴァン デル ウェルヴェン
>> http://www.in-nomine.org/ | http://www.rangaku.org/ | GPG: 2EAC625B
>> Earth to earth, ashes to ashes, dust to dust...
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Robert Kern <robert.kern at gmail.com>
>> To: python-list at python.org
>> Date: Thu, 29 Jan 2009 00:47:46 -0600
>> Subject: Re: Profiling Python Apps on Mac?
>> On 2009-01-28 13:14, RGK wrote:
>>>
>>> I'm writing a python app on a Mac (in Eclipse + PyDev w/ Python2.5 &
>>> wxPython under OSX 10.4)
>>>
>>> As I make program architecture decisions, it would be nice to be able to
>>> profile the choices. Should I add that extra thread? Is this big-assed
>>> xml object I just created horribly bloated or kind of ordinary.
>>>
>>> Is there anything out there I should look into to if I want to see how
>>> those things are affecting my app? The closest I have is the widget
>>> iStat, but it's a very static low resolution view of what's really going
>>> on.
>>
>> I have a script kernprof.py which provides a few conveniences over the
>> builtin cProfile module. One of its modes of operation is to inject a
>> decorator into the __builtins__. It will enable the profiler on entry to the
>> method and disable it on exit. This lets you localize your profile results
>> to just the part of your code that you are interested in. I found this
>> especially useful in GUI apps which require user interaction to trigger the
>> part of the code you are actually interesting in profiling. You don't want
>> the interesting parts of your profile to be obscured by the GUI event loop
>> waiting for your input.
>>
>> You can get it as part of my line_profiler package (which you may also be
>> interested in; cProfile profiles function calls, line_profiler profiles
>> individual lines).
>>
>>  http://pypi.python.org/pypi/line_profiler
>>
>> You can view the profile results interactively with "python -m pstats
>> my_script.py.prof", RunSnakeRun, or pyprof2calltree if you manage to install
>> kcachegrind on your system:
>>
>>  http://www.vrplumber.com/programming/runsnakerun/
>>  http://pypi.python.org/pypi/pyprof2calltree/1.1.0
>>
>> I don't recommend using hotshot because it is deprecated and slow to
>> postprocess the data dumps. Also, I don't recommend using the plain profile
>> module because it slows down your program rather more than cProfile. See the
>> Python documentation for an overview of these modules:
>>
>>  http://docs.python.org/library/profile
>>
>> --
>> Robert Kern
>>
>> "I have come to believe that the whole world is an enigma, a harmless
>> enigma
>>  that is made terrible by our own mad attempt to interpret it as though it
>> had
>>  an underlying truth."
>>  -- Umberto Eco
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Tino Wildenhain <tino at wildenhain.de>
>> To: Tim Chase <python.list at tim.thechases.com>
>> Date: Thu, 29 Jan 2009 07:59:58 +0100
>> Subject: Re: Results of executing hyperlink in script
>> Tim Chase wrote:
>>>>
>>>> 1. This method was suggested by Cameron Laird:
>>>>
>>>>      os.system("start %s" % URL)
>>>>
>>>> It works. But, if the URL contains character &, it will fail. For
>>>
>>>
>>> As an aside, the START command is a bit picky regarding quotes. You have
>>> to use this horrible contortion
>>>
>>>  os.system('start "title" "%s"' % URL)
>>>
>>> The "title" is optional content-wise, but required positionally if
>>> there's a quoted resource, so you can just use
>>>
>>>  start "" "%s"
>>>
>>> a pain, but that's CMD.EXE for you. :)
>>
>> ah, and just for the records, at least
>> os.popen2,os.popen3 support tuple as argument:
>>
>> i,o=os.popen2((cmd,arg1,arg2)) and quotes them
>> correctly.
>>
>> Regards
>> Tino
>>
>>
>> ---------- Forwarded message ----------
>> From: afriere at yahoo.co.uk
>> To: python-list at python.org
>> Date: Wed, 28 Jan 2009 23:15:23 -0800 (PST)
>> Subject: Re: I'm a python addict !
>> On Jan 27, 4:52 am, Paul McGuire <pt... at austin.rr.com> wrote:
>> [snip]
>> >
>> >     # how you have to do it in C++ and Java
>> >     # light = light.next_state()
>> >
>> >     # using Python
>> >     light.__class__ = light.next_state
>>
>> I'm sure you can, but why poke yourself in the eye with a blunt
>> stick? ;)
>>
>> IMO there are two obvious problems with the latter approach.  Firstly
>> the information about the next state is left lying about in some
>> namespace separate from the object, whereas the object itself ought to
>> know what it's 'next_state' is (or, more correctly, how to determine
>> it).
>>
>> Secondly you miss the opportunity of sending a signal to the new
>> state.  Consider that in some jurisdictions the amber light shows
>> before the green as well as before the red (yeah, I know is that an
>> invitation for drag racing or what!?).  If you called next_state as a
>> verb you could pass the current state as an argument and the amber (or
>> yellow, if you prefer) light could work which of the two possible next
>> states to call in turn.  The fact that this behaviour is, in this
>> example, peculiar to the amber light, demonstrates the pertinence of
>> my first objection above.
>>
>> Fortunately the "C++ and Java" approach, (though I would never want to
>> be seen advocating the C++ or Java approach to anything), is in this
>> case available in Python as well, at the cheaper price of fewer
>> characters and arguably greater readibility to boot.
>>
>> I know, Iknow ... you wanted to show how that code could be used in a
>> non "sulphurous" way.  Which just goes to show that the devil makes
>> work for idle hands ... or foils the best laid plans ... or is in the
>> detail ... or something sulphurous. :)
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: "eGenix Team: M.-A. Lemburg" <info at egenix.com>
>> To: "Python List @ Python.org" <python-list at python.org>
>> Date: Thu, 29 Jan 2009 09:37:49 +0100
>> Subject: ANN: eGenix mx Base Distribution 3.1.2
>> ________________________________________________________________________
>>
>> ANNOUNCING
>>
>>                    eGenix.com mx Base Distribution
>>
>>                   Version 3.1.2 for Python 2.3 - 2.6
>>
>>               Open Source Python extensions providing
>>                     important and useful services
>>                        for Python programmers.
>>
>> This announcement is also available on our web-site for online reading:
>>
>> http://www.egenix.com/company/news/eGenix-mx-Base-Distribution-3.1.2-GA.html
>>
>> ________________________________________________________________________
>>
>> ABOUT
>>
>> The eGenix.com mx Base Distribution for Python is a collection of
>> professional quality software tools which enhance Python's usability
>> in many important areas such as fast text searching, date/time
>> processing and high speed data types.
>>
>> The tools have a proven record of being portable across many Unix and
>> Windows platforms. You can write applications which use the tools on
>> Windows and then run them on Unix platforms without change due to the
>> consistent platform independent interfaces.
>>
>> Contents of the distribution:
>>
>>  * mxDateTime - Date/Time Library for Python
>>  * mxTextTools - Fast Text Parsing and Processing Tools for Python
>>  * mxProxy - Object Access Control for Python
>>  * mxBeeBase - On-disk B+Tree Based Database Kit for Python
>>  * mxURL - Flexible URL Data-Type for Python
>>  * mxUID - Fast Universal Identifiers for Python
>>  * mxStack - Fast and Memory-Efficient Stack Type for Python
>>  * mxQueue - Fast and Memory-Efficient Queue Type for Python
>>  * mxTools - Fast Everyday Helpers for Python
>>
>> All available packages have proven their stability and usefulness in
>> many mission critical applications and various commercial settings all
>> around the world.
>>
>> For more information, please see the distribution page:
>>
>>    http://www.egenix.com/products/python/mxBase/
>>
>> ________________________________________________________________________
>>
>> NEWS
>>
>> The 3.1.2 release of the eGenix mx Base Distribution is the latest
>> release of our open-source Python extensions.
>>
>> We have fixed a number of small platform issues and added support for
>> the strptime() function to mxDateTime on Windows. We have also enhanced
>> the portability of our pre-built Mac OS X binaries.
>>
>> As always, we are providing pre-built binaries for all supported
>> platforms, currently: Windows 32-bit, Linux 32-bit, Linux 64-bit,
>> FreeBSD 32-bit, FreeBSD 64-bit, Mac OS X 32-bit Intel and PPC.
>>
>> Whether you are using a pre-built package or the source distribution,
>> installation is a simple "python setup.py install" command in all
>> cases. The only difference is that the pre-built packages do not
>> require a compiler to be installed.
>>
>> For a list of changes, please refer to the eGenix mx Base Distribution
>> change log at
>>
>>    http://www.egenix.com/products/python/mxBase/changelog.html
>>
>> and the change logs of the various included Python packages.
>>
>> ________________________________________________________________________
>>
>> DOWNLOADS
>>
>> The download archives and instructions for installing the packages can
>> be found on the eGenix mx Base Distribution page:
>>
>>    http://www.egenix.com/products/python/mxBase/
>>
>> ________________________________________________________________________
>>
>> LICENSE
>>
>> The eGenix mx Base package is distributed under the eGenix.com Public
>> License 1.1.0 which is an Open Source license similar to the Python
>> license. You can use the packages in both commercial and non-commercial
>> settings without fee or charge.
>>
>> The package comes with full source code
>>
>> ________________________________________________________________________
>>
>> SUPPORT
>>
>> Commercial support for this product is available from eGenix.com.
>> Please see
>>
>>    http://www.egenix.com/services/support/
>>
>> for details about our support offerings.
>>
>> Enjoy,
>> --
>> Marc-Andre Lemburg
>> eGenix.com
>>
>> Professional Python Services directly from the Source  (#1, Jan 29 2009)
>> >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>> >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>> >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
>> ________________________________________________________________________
>>
>> ::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
>>
>>
>>   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
>>    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
>>           Registered at Amtsgericht Duesseldorf: HRB 46611
>>               http://www.egenix.com/company/contact/
>>
>>
>>
>>
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> Regards,
>
> Maneesh KB
>
> Comat Technologies
>
> Bangalore
>
> Mob: 9740-192309
>
>
>
> We work with the underprivileged and in rural India. If you are interested
> to be a part of it, please mail or call me. I will be happy to share and
> inform - http://www.comat.com
>
> --
> http://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list