Monkey patching new style classes

2007-11-29 Thread David Coffin
Is it possible to add an attribute to a new style class where the name of that attribute is determined at runtime? In other words, is there an new style class alternative to adding items to a classes __dict__ ? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Beautiful Soup Question: Filtering Images based on their width and height attributes

2006-12-04 Thread David Coffin
> Hello, > > I want to extract some image links from different html pages, in > particular i want extract those image tags which height values are > greater than 200. Is there an elegant way in BeautifulSoup to do this? Yes. soup.findAll(lambda tag: tag.name=="img" and tag.has_key("height") an

Debugging Builds

2006-09-08 Thread David Coffin
Hi, Is there any documentation concerning the Python debugging builds beyond section 1.5 in the Python/C API reference manual and Misc/ SpecialBuilds.txt file in the source code? I'd like to know how people generally go about debugging memory leaks in C extensions. Thanks, David -- htt

Re: changing value of 'self' when subclassing int

2006-02-21 Thread David Coffin
s of integers. Ideally, I could have created a class for the bitstring individuals that also supported list based bit assignment (without too much overhead). Best wishes, David Coffin -- http://mail.python.org/mailman/listinfo/python-list

changing value of 'self' when subclassing int

2006-02-20 Thread David Coffin
e way for me to change the value of the BitSequence object itself? I've also tried wrapping and delegating using __getattr__, but I couldn't figure out how to handle in-place methods. Thanks for your help, David Coffin class BitSequence(int): """An integer emula