Python's "only one way to do it" philosophy isn't good?

John Nagle nagle at animats.com
Thu Jun 28 16:09:19 EDT 2007


Andy Freeman wrote:
> On Jun 27, 11:41 pm, John Nagle <n... at animats.com> wrote:

> While I agree that weak pointers are good and can not be an
> afterthought, I've written code where "back" changed dynamically, and
> I'm pretty sure that Nagle has as well.

    That sort of thing tends to show up in GUI libraries, especially
ones that have event ordering issues.  It's a tough area.

> Many programs with circular lists have an outside pointer to the
> current element, but the current element changes.  All of the links
> implementing the list have to be strong enough to keep all of the list
> alive.
> Yes, one can implement a circular list as a vector with a current
> index, but that has space and/or time consequences.  

    We used to see things like that back in the early 1980s, but today,
worrying about the space overhead associated with keeping separate
track of ownership and position in a circular buffer chain isn't
a big deal.  I last saw that in a FireWire driver, and even there,
it wasn't really necessary.

				John Nagle



More information about the Python-list mailing list