« CherryPy 3 request_queue_sizeStorm, SQLAlchemy, and Geniusql »

Simplify, maaaaan


Permalink 09:11:05 am, by fumanchu Email , 83 words   English (US)
Categories: Python

Simplify, maaaaan

Glyf said:

I've experienced quite a bit of confusion when talking to other python programmers about this stuff, but I'm not sure if it was my awkward explanation of Twisted's plugin system or some inherent issue in Python's path management.

If the implementation is hard to explain, it's a bad idea.

And if you would allow me to comment on your blog without becoming a LiveJournal user, I'd really appreciate it.


Comment from: Glyph Lefkowitz [Visitor] · http://glyf.livejournal.com/

Hi Bob,

I agree!

To clarify my comment there, the "this stuff" is Python's path management, not Twisted's library for it. Once you understand the underlying model of sys.path + os.path + imp + PEP 0302 + zipimport + the "-m" interpreter option + name + module + path, twisted.python.modules is straightforward and obvious enough that it rarely requires explanation at all. But if you start trying to explain twisted.python.modules without any background, it's not clear why you're not just stuffing everything into one directory.

The implementation that's hard to explain is the mess of global variables, obtusely interpreted strings, and (sometimes undocumented) special cases that makes up the import and path systems in Python itself. Not to mention the intersection with tools like virtual-python, Divmod's own Combinator, setuptools's "develop" command, and more. It's made especially hard because on the surface, this stuff is all really obvious and straightforward; 'echo "print 'hello'" >> foo.py; python -c "import foo"' - it looks like it "just works", but everyone has their own (usually incorrect) intuition about what is actually happening there.

To Python's credit, the underlying system for module imports does basically make sense, and the rules are consistent if you think about them for a while. A high-level interface like t.p.m ultimately wouldn't be possible if it didn't.

Regarding not becoming an LJ user: signing up is pretty easy, and while I would value your occasional pithy insight, I'm sorry to say it's not really worth the torrent of spam that I had to delete before I started requiring registration. I hope you'll sign up, but if not; well, I read your blog too.

08/23/07 @ 14:01
Comment from: bignose [Visitor]

Glyph, I wonder whether you'd consider allowing OpenID-authenticated users to post. That's no longer "anonymous", since you have a unique ID for the poster; but it doesn't limit your posters to those who choose Livejournal.

(You too, FuManChu: howsabout we get OpenID authentication for comments here? :-)

08/24/07 @ 02:20
Comment from: Laurent Szyster [Visitor] · http://laurentszyster.be/

"Once you understand the underlying model of sys.path + os.path + imp + PEP 0302 + zipimport + the "-m" interpreter option + name + module + path, twisted.python.modules is straightforward ..."

What's the value of an API that requires understanding of every implementation layers below itself?

None ... unless you live in Twistedland.


08/24/07 @ 04:18

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.)
September 2017
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


The requested Blog doesn't exist any more!

XML Feeds

powered by b2evolution free blog software