470,614 Members | 1,417 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

Reinvent no more forever

Howdy all,

On dirtSimple.org[0], PJE wrote:

"Why is Python "blessed" with so much reinvention? Because it's
often cheaper to rewrite than to reuse. Python code is easy to
write, but hard to depend on. You pretty much have to:

1. limit yourself to platforms with a suitable packaging
2. bundle all your dependencies into your distribution, or
3. make your users do all the work themselves

Ouch. No wonder rewriting looks easier."

He then goes on to talk about his own solution: PyPI, setuptools,
EasyInstall, and so on for better dependency control. He concludes:

"But for right now, I plan to start by putting my dependencies
where my mouth is. I will bundle no more forever, for I am tired
of keeping them up-to-date with their upstream maintainers. I
shall rend my monolithic packages into smaller projects, so that
people can make use of cool parts of PEAK without having to
install anything but the part they want. I will find out if this
stuff really works. From where the setuptools now stand, I will
bundle no more forever."

Fine sentiments. What does this mean for PyPI though? How should those
of us who also want to "reinvent no more forever" proceed? How do we
deal with the rampant proliferation of a zillion implementations of
some standard idiom in PyPI?

The case that led me to this quandary is simple: I'm developing an
application that could become simple, and I'm on the lookout for
pieces that might be valuable outside this application. The first one
to catch my eye is an Enum implementation.

I now have a setuptools package of my Enum implementation. Should I
submit it to PyPI?


- I can declare a dependency on that package for all my other
packages that need such functionality, instead of bundling it
every time.

- Others can benefit from my code, instead of yet again including an
Enum implementation (home-grown, or picked from a cookbook) by a
simple dependency declaration.

- The code hopefully gets improved and generalised and all the other
benefits that accrue to software with many users.


- Proliferation. What's the protocol when[1] someone else puts an
(incompatible, differently-specified) Enum implementation into

- Naming. How many ways can a package providing an Enum be named?
I'd prefer mine to be named "Enum" or "enum", but why should mine
be the one that claims that name?

- It's just a pretty simple type, with unit tests. Does this really
justify a PyPI package?

This is common to any repository of code. But the "automatic
dependency" problem means that all those packages, and many more
outside that repository, need to know how those problems are resolved.

Operating system distributors have policies (to greater or lesser
degrees of strictness) to ensure this kind of quality control. My
understanding of PyPI is that there's no such policy.

I'd love to follow the mantra PJE espouses, but if it's good for one
person it's probably good for countless others. How do we deal with
that? What actions can we take in advance to prevent problems in
[0] <URL:http://dirtsimple.org/2005/07/reinvent-no-more-forever.html>

[1] Of course, someone already has. I prefer mine to theirs, hence the

\ "I planted some bird seed. A bird came up. Now I don't know |
`\ what to feed it." -- Steven Wright |
_o__) |
Ben Finney
Nov 22 '05 #1
0 924

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Robert Stearns | last post: by
1 post views Thread by Yannick Turgeon | last post: by
28 posts views Thread by Stefano Masini | last post: by
1 post views Thread by Amil Hanish | last post: by
16 posts views Thread by Ben Finney | last post: by
6 posts views Thread by alessandro | last post: by
4 posts views Thread by Ronald S. Cook | last post: by
3 posts views Thread by Inny | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.