| HowDoI | whats oop im going to google |
| iacopop | object oriented programming |
| HowDoI | ty |
| kosh | iacopop: it is very rarely needed |
| iacopop | kosh: why? |
| kosh | iacopop: for example most of the design patterns in the gof book you see are artifacts of how c++ does things |
| Fossilet | Hello, kosh. |
| kosh | iacopop: the design patterns where designed to get around problems in the language and codify the common ways of getting around stuff in the language |
| iacopop | infact i'm searching something in python |
| Jerub | singleton is a really good example of what's hard in C++ and easy in python in python to do a singleton you do this: class MyClass: # put methods here |
| iacopop | i know |
| Jerub | MyClass = MyClass() |
| iacopop | stop |
| kosh | singlton is a bad idea though in general |
| Jerub | and some python programmers go to incredibly lengths to do the same thing :( |
| kosh | later if it turns out your don't need a singleton then fixing stuff can be a royal pain in the neck |
| Jerub | heh, yeah |
| extr3m | does anyone here know of a working trapd implementation in python (for snmp) ? |
| Jerub | well, the only place I can think where it makes sense is a fieldstorage object in cgi programming |
| kosh | it is better to be explicit about theo bject reference and keep it around it is just that nearly every c++/java design pattern has a 2-4 line version to do the same thing in python very simply so why write up a whole bunch of design patterns when if you go to solve the problem the natural solution would be the one you choose anyways? design patterns are written up because they are hard, not because anyone could trip and fall and figure it out |
| iacopop | but i working in a big project in python, and i would like to make things easy knowing some patter; surfing in google i find something oriented to python and i'm searching some book i you don't use pattern you cannot make a goog "Big" project that's sure |
| kosh | I don't agree at all patterns are artifacts of bad language design for the most part iacopop: how large are you defining as a big project? Jerub: one problem I haev run into comparing code size is I have seen projects done in 1M loc that where later refactored to about 50K :) |
| iacopop | big means: reusable, modular extendibl |
| kosh | I have done more then a few reusable, modular and extentable projects with no patterns |
| redir | funny I though big meant large |
| kosh | I also know of other large projects that are done and meet all those requirements loop at zope, twisted, and a host of other projects that are easily qualified as large |
| jkp | can someone tell me where datetime lives? |
| Yhg1s | jkp: the datetime type lives in the datetime module. |