News for hackers. Stuff that matters.
Re:A Hodgepodge of Python by notaddicted on Thursday September 15, 2011 @05:17PM (#3002171)
I'm still on the fence as to whether this is acceptably ugly or unacceptably ugly, but it does make use of a python feature:

  >>> 
  >>> class PrefixStr:
  ...   def __init__(self, prefix):
  ...     self.prefix = prefix
  ...   def __getattr__(self, s):
  ...     return self.prefix+s
  ... 
  >>> 
  >>> q = PrefixStr('xyz_')
  >>> 
  >>> { q.height:11, q.width:7, q.depth:3 }
  {'xyz_width': 7, 'xyz_depth': 3, 'xyz_height': 11}
  >>>
Re:A Hodgepodge of Python by Estragon on Thursday September 15, 2011 @07:32PM (#3002523)
The main question is whether it increases the clarity and flexibility of the code. I can't think of any contexts where it would, but I wouldn't rule it out.