On Thu, 27 Jan 2005 18:31:55 -0700, Fernando Perez <fperez.net at gmail.com> wrote: > However, I think it would perhaps be best to advertise any methods of Bunch as > strictly classmethods from day 1. Otherwise, you can have: > > b = Bunch() > b.update(otherdict) -> otherdict happens to have an 'update' key > > ... more code > > b.update(someotherdict) -> boom! update is not callable > > If all Bunch methods are officially presented always as classmethods, users can > simply expect that all attributes of a bunch are meant to store data, without > any instance methods at all. That sounds reasonable to me. I'll fix update to be a staticmethod. If people want other methods, I'll make sure they're staticmethods too.[1] Steve [1] In all the cases I can think of, staticmethod is sufficient -- the methods don't need to access any attributes of the Bunch class. If anyone has a good reason to make them classmethods instead, let me know... -- You can wordify anything if you just verb it. --- Bucky Katt, Get Fuzzy
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4