[Twisted-Python] Python a post-Object Oriented Language?
Hi, I saw the above characterization in one of the itamarst.org twisted presentation slides. Although I'm just a journeyman programmer and somewhat unaccustomed to the rarefied atmosphere of many twisted Python discussions, I'm curious to hear why Python would be "post-OOP". If I recall correctly, my little O'Reilly C++ book said that OOP meant you had 4 things (abstraction, encapsulation, hierarchy and something else that escapes me at the moment, maybe "coolness"). I also recall that compiled C++ had a hard time doing the neat tricks that an interpreted language can do and was necessarily limited by its origin as a preprocessor step in front of a classic C compiler. There were some minor differences like automatic constructor chaining in C++, as opposed to manual __init__ chaining in Python. There were some major differences like being able to dynamically set attributes on an object, and the replacement of data hiding by convention in Python. Given that background, I'm just curious to hear the grounds on which Python can be classified as post-OOP. Any comments?
On Wed, Nov 19, 2003 at 12:45:26PM -0800, John Benson quipped:
Given that background, I'm just curious to hear the grounds on which Python can be classified as post-OOP. Any comments?
Fortunately or unfortunately, there's no single, one, common definition for OOP. There is wide disparity in featuresets among languages which are commonly held to be object-oriented. Jonathan Rees gives us a nice catalog of some of the features typically associated with OO here: http://paulgraham.com/reesoo.html In what respect is Python "post-OO"? Well, you could say that a language which combines OO features with nice first class functions and list comprehensions, while eliminating some of the Java cruft, is "post-OO". But you could say the same for CLOS, or Self, which are 20 and 15 years old respectively, predating the widespread adoption of OO by a good many years. So, maybe Python is "pre-OO"? Here's an article in American Scientist alledging the existence of a post-OO paradigm, including XP, aspects, and design patterns: http://www.americanscientist.org/Issues/Comsci03/03-03Hayes.html
I have a two-screen mini test application. Each screen has a page.Page subclass and a template associated with the page.Page. Let's call them welcomePage and nextPage. welcomePage.html has a form whose action is "nextPage." WelcomePage has a wchild_nextPage() method which returns an instance of NextPage. When welcomePage's form is submitted, WelcomePage's wchild_nextPage() gets called twice. The first time it gets called with the expected request args, the second time the request args dictionary is empty. Obviously I'm doing something wrong, but what? -k
On Wed, 19 Nov 2003 14:51:58 -0800
Kevin Unger
When welcomePage's form is submitted, WelcomePage's wchild_nextPage() gets called twice. The first time it gets called with the expected request args, the second time the request args dictionary is empty.
Pages by default redirect so they have a / at the end. So you submit to http://foo/nextPage and that gets redirected to http://foo/nextPage/. Solutions: 1. submit to /nextPage/ from the start. 2. set addSlash=0 on NextPage. -- Itamar Shtull-Trauring http://itamarst.org/ Available for Python & Twisted consulting
participants (4)
-
Itamar Shtull-Trauring
-
John Benson
-
Kevin Unger
-
Robert Church