#python - Mon 19 Mar 2007 between 16:52 and 17:09

NY Lost Funds



BernardoBombis that a module?
kbrooksyeah BernardoBomb
BernardoBombk, i'll look into that
thanks
arkanesBernardoBomb: you will need it or comtypes to do COM in python, pywin32 has better samples
BernardoBombalright
PeperYhg1s: is there anything like c++ singletons in python? in C++ I have a get_instance method. How would you expose that? For now I have just externat function which returns the object. Can it be somehow added as the class attr?
dingus9hey I am trying to use the module Carbon.Scrap on my apple, and I keep getting a bus error, I also was wondering if there was a Carbon.Pasteboard module since apple says to use the newer pasteboard api now
kbrooksSo, I have a question. http://rafb.net/p/ek68cF61.html # any comments?
polpakPeper: you can have class methods
Peperpolpak: but I can't use them when the object is not yet created
and the get_instance method is supposed to create it
Yhg1sPeper: I don't understand the question, sorry. I also notice it's a Boost specific question -- there's no 'get_instance' method in normal CPython.
polpakPeper: yes you can
PeperYhg1s: no, it's not the boost specific. get_instance is just the C++ method which is used in the app to get an instance of an object
And I want to expose it
kbrooksBasically, http://rafb.net/p/ek68cF61.html is a program which shows a image and you have to type a word which the image represents.
PeperYhg1s: singletons are classes of which you can create just one instance
kbrooksI wold like to extend http://rafb.net/p/ek68cF61.html for multiple images. Right now, the image is hardcoded to earth.
polpakPeper: you can call a class method from the class
Peper: rather than an instance of the class
Yhg1sPeper: yes. I know what singletons are. They are pretty stupid in Python. Just use a module to store the singleton.
kbrooksI have a data.db file which is a word -> image path mapping...
How do I implement it into the program generally?
PeperYhg1s: use a module to store? could you please elaborate?
kbrooksPeper:
foo = None
class Foo:
polpakPeper: import mysingletonmod; inst = mysingletonmod.the_instance
kbrookspass
foo = Foo()
Yhg1sPeper: just create the one-and-only instance at module-load time, store it in the module as a normal module attribute.
polpaksince modules are singletons themselves technically, module attributes are also singletons
Malawarit appears linked lists have just been patented :(
kbrooksMalawar, well, they won't go around suing ALL the independent developers of linked lists. Proof please?
fydoyay python
Malawarhttp://www.patentstorm.us/patents/7028023.html
of course it's not going to work, way too much prior art :P
but the patent went through
kbrooksMalawar, Reading

Page: 4 11 18 25 32 39 46 53 60 67 74 81 88 

IrcArchive

NY Lost Funds