Presentation is loading. Please wait.

Presentation is loading. Please wait.

Developers Day 2002 Making classes look like types (and vice versa) Or…

Similar presentations


Presentation on theme: "Developers Day 2002 Making classes look like types (and vice versa) Or…"— Presentation transcript:

1 Developers Day 2002 Making classes look like types (and vice versa) Or…

2 Developers Day 2002 Compound W for Pythons object model Or…

3 Developers Day 2002 Goading Guido into describing something only he (fully) understands

4 (C) 2002 Zope Corp. 4 New stuff… properties descriptors (?) old-style classes (ok, old stuff) new builtins –object, super, property, staticmethod, classmethod, dict, … new-style classes method resolution order

5 (C) 2002 Zope Corp. 5 What about metaclasses…?

6 (C) 2002 Zope Corp. 6 What about metaclasses…? >>> brain.kaboom()

7 (C) 2002 Zope Corp. 7 More new stuff… __getattribute__() property interface –__get__() –__set__() –__delete__() __slots__ __mro__ __new__()

8 (C) 2002 Zope Corp. 8 Issues… Status of PEPs 252, 253, 254 More syntactic support –staticmethod –classmethod, etc… Limitations in extending C types –Adding C slots Documenting everything

9 (C) 2002 Zope Corp. 9 Questions… Has anybody used it for real? Usability? Functionality? Promoting this stuff from experimental status Getting rid of classic classes? Performance?

10 (C) 2002 Zope Corp. 10 References… http://www.python.org/2.2/descrintro.html http://python.sf.net/peps/pep-0252.html http://python.sf.net/peps/pep-0253.html http://python.sf.net/peps/pep-0254.html Putting Metaclasses to Work: A New Dimension in Object-Oriented Programming, by Ira R. Forman and Scott H. Danforth. Addison-Wesley, 1999, ISBN 0-201-43305- 2.


Download ppt "Developers Day 2002 Making classes look like types (and vice versa) Or…"

Similar presentations


Ads by Google