"Daniel Klein" <DanielK at jBASE.com> wrote: > Haven't posted for a while but I this time I am requesting some assistence. > > I'm putting on a presentation on the benefits of Python over Java and one of > the points I would like to make is how everything is an object, even > Classes. Can anyone out there in PythonVille provide a simple (practical) > example of how classes can be used as objects? Ken Seehof wrote: > Here's a debugging hack that messes with classes: [ ... ] While I agree it's useful to mess with this stuff for debugging, but you don't need to go that for for classes to be useful as objects: classes can be seen as factory functions, and passed around as such, eg: class Foo: helperFactory = HelperClass def __init__(self, arg): self.helper = self.helperFactory(arg) class Boo(Foo): helperFactory = OtherHelperClass Just
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