« Firefox tip #34928509: nameless bookmarksCherryPy in epydoc format »

Is CherryPy a web framework?


Permalink 09:00:23 pm, by fumanchu Email , 332 words   English (US)
Categories: Python, CherryPy, WSGI

Is CherryPy a web framework?

Guido van Rossum recently wrote:

Python, in its design philosophy, tries hard not to be a framework. (This sets it apart from Java, which is hostile to non-Java code.) Python tries to be helpful when you want to solve part of your problem using a different tool. It tries to work well even if Python is only a small part of your total solution. It tries to be agnostic of platform-specific frameworks, optionally working with them (e.g. fork and pipes on Unix) but not depending or relying on them. Even threads are quite optional to Python.

Oddly enough, this is how I feel about CherryPy, that it tries hard not to be a framework. It tries to be helpful, recognizing that it's most likely only part of your solution. It tries to be agnostic of templating and persistence systems, and has little to say about markup languages, content-types, site architecture, or RPC formats.

Guido was responding to Phillip J. Eby, who wrote:

A Pythonic framework shouldn't load you down with new management burdens and keep you from using other frameworks. It should make life easier, and make your code more interoperable, not less. Indeed, I've pretty much come to agreement with the part of the Python developer community that has says Frameworks Are Evil.

Not wanting to be Evil, I've tried to make CherryPy 2.1 a system which doesn't load you down with new management burdens. Instead, it exposes the functionality of HTTP by presenting it in a Pythonic way. I and many others think it makes life easier—CherryPy appears to have an underscore-shaped learning curve. ;) And as for interoperability, CherryPy was one of the first Python web-application servers to grow a WSGI interface.

I suppose that CherryPy will always have to bear the moniker of "framework", if only because it calls your code, instead of the other way around. But let's keep it a Pythonic framework as long as we can.


Comment from: Chris McDonough [Visitor] · http://www.plope.com

I think I understand what you're trying to say here, but a nit...

If create something in Python that isn't a library which other code must plug in to describing it as "more pythonic" than something else doesn't seem to make much sense to me. At the end of the day, a framework is just an application that happens to be designed to be highly end-user extensible.

I would never try to describe an address book application I wrote in Python as "pythonic". It's just meaningless, and even maybe misleading (as if its functionality had something to do with Python). That said, I could imagine if I called it "Evolution-like" or "Address Book.app"-like. I might even call it "library-like" if it contained coponents that can be used by other components. But I'd never try to describe it as "pythonic".

10/21/05 @ 10:10
Comment from: fumanchu [Member] Email

Hi Chris,

I meant "pythonic" in the sense of "what Guido just said python tries to be"; that is, helpful rather than hostile, and agnostic rather than dependent (PJE uses the term in much the same way). CherryPy's functionality may not have anything to do with Python, but that doesn't mean its design has nothing in common with the design of Python. In that sense, it could be written in Java and still try to be "pythonic".

If we take your definition of "framework", CherryPy is not a framework and never was; it has no "application-nature". It's different than an address book application, because an address book app (or even an address book framework) assumes a problem domain: addressing. CherryPy doesn't assume a problem domain; instead, it facilitates message-transfer according to the HTTP spec.

So I hear you answering "no" to the question in my subject, "Is CherryPy a web framework?". I'm leaning toward "no" myself for the same reasons. I tend to call CherryPy an "HTTP application server" these days, instead.

10/21/05 @ 13:16

Leave a comment

Your email address will not be revealed on this site.

Your URL will be displayed.

Please enter the phrase "I am a real human." in the textbox above.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
October 2018
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      


The requested Blog doesn't exist any more!

XML Feeds

powered by b2evolution