A snake came to my water-trough

I’ve been coding Python for most of the day.  Well, in between housekeeping duties.  I have a vague sense that my love of Python has reached a plateau.  What bothers me most is that the data model is quite complicated.  The distinction between sets, frozensets, tuples, and lists leads to a lot of ugly code, such as s = tuple([tuple()]).  I suppose I could have written s = ((),) which is not much better.  In other places, though, I have to throw values around from type to another.  It is a pity that sets and lists are not hashable, otherwise I wouldn’t be mucking with all these types.  Oh well, perhaps any language that is sufficiently powerful is going to contain such problems.  Perhaps I, too, have some pettiness to expiate.

I must admit that Python makes it much easier to implement high-level algorithms in a semi-readable way.  I don’t really see myself writing long programs in Python:  I use it mostly for prototyping.  And there are many cases where I would rather turn to awk or perhaps even PHP.

2 Responses to A snake came to my water-trough

  1. I’ve been wondering about the hashability and why it is so. The identifier for a list could, in theory, contain a constant hash value, generated when the object is generated. I wonder why this is not so.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>