IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.67 MB
Powered by
Channel Info
Network: freenodeChannel: #python |
Search in www.irclog.org
Log from #python at freenode 2006-05-20
[21:43]<sdyvxa>+so here's another, potentially related issue
[21:43]<sdyvxa>+if i comment out the if
[21:43]<sdyvxa>+i get this: TypeError: unbound method setup() must be called with AutoPackageRecipe instance as first argument (got Tcpdump instance instead)
[21:44]<yxrws>+ok, so what happens is that what RPMPackageRecipe.setup() (at method call time) calls AutoPackageRecipe, isn't what Tcpdump() (at class creation time) calls AutoPackageRecipe
[21:45]<yxrws>+they are both referring to AutoPackageRecipe, but it has been reassigned, in the mean time. reload() does that, for instance, but so would a 'yourmod.AutoPackageRecipe = ...' from outside the module or just an 'AutoPackageRecipe = ...' inside it.
[21:45]<yxrws>+right now, loadSuperClass() looks to be the culrpit.
[21:46]<yxrws>+and also the culprit.
[21:47]<sdyvxa>+Yhg1s: i'll go looking through loadSuperClass then; bbr
[21:47]<sdyvxa>+brb, even
[21:49]<sfudrrfd>+What data type would be fastest when handling huge loads of files?
[21:49]<-- mzvv_j xzs fudv (>http://www.daphne-emu.com")
[21:49]<sfudrrfd>+Like, say, 1800 mp3s
[21:50]<2smgv2jm2mjjm>+squiggly: what do you mean
[21:50]<sdyvxa>+Yhg1s: no reload() in loadSuperClass
[21:51]<sfudrrfd>+I'm thinking about writing a script that uses id3lib to rewrite my mp3's tags & filenames
[21:51]<sfudrrfd>+they're in ugly formats, depending on wherever i got them; pearl_jam-World_Wide_Suicide_.mp3, etc
[21:53]<zjzdd>+squiggly: just use normal python data types. in this case i'd be much more worried about dud file names from bugs than speed
[21:53]<yxrws>+smithj: reload() is just an example.
[21:53]<yxrws>+(and remember that reload() can be called from anywhere)
[21:54]<yxrws>+somewhere between the creation of the Tcpdump *class* (not instance), and the execution of RPMPackageRecipe.setup() (not definition), AutoPackageRecipe gets reassigned.
[21:54]<yxrws>+well, either that, or Tcpdump gets monkeypatched so that AutoPackageRecipe is not one of its baseclasses anymore.
[21:54]<sfudrrfd>+roryy, hm ok
[22:21]<vyzus>+I'm currently planning to do some "fast & simple" web development with python. I'm sick of PHP and Java is just too complex for most tasks.
[22:23]<vyzus>+I'd like to use something that is simple to learn, yet extensible. I already know how to code python, know and use concepts like MVC a lot and would like some action framework.
[22:23]<zjzdd>+virus: maybe this will help: http://wiki.python.org/moin/WebProgramming
[22:23]<vyzus>+I'm currently reading http://wiki.python.org/moin/WebProgramming but that list is a bit too comprehensive and I just don't know where to start. (I've been looking at Zope and Twisted Web (Nevow, Stan,...) so far.
[22:23]<zxzzfns`>+virus, I think you might like django
[22:23]<zjzdd>+virus: oh, oops ;)
[22:24]<zxzzfns`>+virus, if you want just a simple file you can drop in and start making some stuff appear on your browser though I'd recommend web.py
[22:24]<zzfzmzgmnz>+virus top contenders for MVC type programming these days seem to be TurboGears and Django
[22:25]<gyacwqt>+I personally like Django here though...
[22:25]<zxzzfns`>+here's a decent talk on django http://video.google.com/videoplay?docid=-70449010942275062&q=django
[22:25]<vyzus>+charles`, right now I'm using Java+WebWork+Spring+Hibernate+... for a commercial project. But the getting started time is just inacceptable for some not too sophisticated projects. :-/ - and btw. I like the python way of doing thing. :-)
[22:29]<2fzacmzjym_wm>+virus: id go for tg if its more of an application than a "website"
[22:31]<2fzacmzjym_wm>+virus: http://snakesandrubies.com/ <- this one is pretty nice aswell.
[22:32]<2fzacmzjym_wm>+video talk
[22:32]<2fzac2|zm>+What's the best way to get the name for a given IP?
[22:32]<2fzac2|zm>+in Python of course :)
[22:32]<2fzacmzjym_wm>+socket.gethostbyaddr("127.0.0.1"
[22:32]<2fzacmzjym_wm>+)
[22:32]<2fzac2|zm>+thx
[22:37]<sfudrrfd>+If you set it to connect to a domain, shouldn't it resolve to the IP anyway?
[22:38]<vyzus>+blackdroid_wd, mmmh, when it comes to full bloated and more complex web apps I'll stick to Java (with that bunch load of libraries) - I'm looking for something simple and lightweight that replaces that PHP solution I've been writing so far. Something that fits both scenarios well (web apps, web sites) would be best of course. ;)
[22:39]<c2zjjcs>+virus: web.py?
[22:39]<c2zjjcs>+webpy.org
[22:41]<-- dyzyvzf00 xzs fuy>http://www.digital00.com <-- NEW!")
[22:41]<yjgnf_da>+virus: cherrypy
[22:42]<vyzus>+Funny. One question - thousand answers. ;-)
[22:43]<rxdggy>+Features != Bloat >:(
[22:43]<vyzus>+But so far it pushed me into a completely new direction. So far I've only been looking at Twisted.Web/Nevow, Spyce and Zope. ;)
[22:43]<gyacwqt>+I personally like django, it scales really well, especially with memcache
[22:43]<c2zjjcs>+Orwell 0.1 alpha 2 released! Orwell aims to be a text editor that is crossplatform, simple and easy to use and contribute to. You can download it here: http://kbrooks.ath.cx/orwell-0.0.2.tar.gz . Instructions: Extract the tarball, cd into the new directory created, then run Orwell by doing the command "python orwell.py" (without the quotes) in a terminal. We stilll have a long way to go. Please help shape the future of Orwell by giving YOUR feedba
[22:43]<c2zjjcs>+ck! Your feedback will go into improving future releases! #orwell is the channel if you want to chat there.
[22:43]<yjgnf_da>+at a IT question every specialist has a different answer ;)
[22:44]<gyacwqt>+I've had a site, with django caching, get 3500 req/sec
[22:44]<c2zjjcs>+nick125: very nice
[22:44]<gyacwqt>+with lighttpd, of course
[22:44]<vyzus>+ionel_mc, of course. And every IT specialist has a different answer on the same question depending on the time and his/her mood. :P
[22:44]<gyacwqt>+static files got 5600req/sec though
[22:45]<gyacwqt>+of course, if I gave that server more then 256MB ram, it would do better..lol
[22:45]<c2zjjcs>+:-)
[22:45]<c2zjjcs>+yeah, i agree
[22:45]<yjgnf_da>+virus: yeah... but there is one exception. i'am always right
[22:45]<yjgnf_da>+i'm
[22:45]<gyacwqt>+but, being able to burst 50% on a dual CPU 3.0ghz xeon helps too :)
[22:47]<c2zjjcs>+nick125: whoo!
[22:47]<yjgnf_da>+heh... that was ironic.. everybody is right :P
[22:49]<gyacwqt>+I wish that the xen xm.py code wasn't entire unreadable junk..
[22:53]<vyzus>+Mmmh. so far django looks quite nice - but I'll have a look at the other frameworks mentioned here, too. ;-)
[22:53]<gyacwqt>+I like django templating to..
[22:54]<rlvrxr2>+hello
[22:58]<rlvrxr2>+I have a class A(dict) with function definitions for __str__ and __repr__. However, every time I call str() on an instance, I get the same result as repr(). Any ideas what I could be doing wrong?
[23:00]<zjzdd>+cptahab: maybe you could show us the code on a pastebin?
[23:02]<rlvrxr2>+roryy: I'm cutting out the relevant parts right now
[23:05]<vgzrajg_>+Does anyone know how I'd find the largest amounts of redundancy in a string (kind of like some compression algorithms do)?
[23:06]<zjzdd>+cptahab: a hard-to-spot error which came up on the mailing-list was misspelling __str__ or __repr__ by adding an extra _ at the end (or beginning, i guess)
[23:07]<ajn_c>+veracon_: maybe a suffix tree or trie?
[23:07]<ajn_c>+or PATRICIA tree?
[23:07]<rlvrxr2>+Here is some code that reproduces the error:
[23:07]<rlvrxr2>+http://rafb.net/paste/results/hVQqP422.html
[23:07]<ajn_c>+i believe those store common substrings
[23:08]<vgzrajg_>+joe_k: Whoa, any more information on those?
[23:08]<rlvrxr2>+If I comment out the __repr__ definition, __str__ works fine
[23:09]<ajn_c>+dict.__str__ probably calls __repr__
[23:09]<ajn_c>+since the repr and str of a standard dict are identical
[23:10]<ajn_c>+so dict.__str__ is calling your __repr__ to produce the __str__!
[23:10]<ajn_c>+interesting problem with inheritance
[23:10]<ajn_c>+how do you tell a superclass method call to use the superclass method instead of your own!
[23:10]<rlvrxr2>+joe_k: hm...
[23:10]<ajn_c>+(for methods that it uses on self)
[23:10]<zjzdd>+call dict.__repr__ instead
[23:10]<vgzrajg_>+Well, I found a Python Trie implementation, will have a look
[23:10]<rlvrxr2>+I tried the same with super(), and received the same result
[23:11]<zjzdd>+def __str__(self): return dict.__repr__(self)
[23:11]<ajn_c>+cptahab: its not your code that is calling the wrong function, its dict.__str__.... which probably does "return self.__repr__()"
[23:11]<rlvrxr2>+joe_k: that arument makes sense
[23:11]<rlvrxr2>+thanks
[23:11]<zjzdd>+yeah, just put a 'print "repr"' in the repr method, and you'll see that's what happens
[23:12]<rlvrxr2>+Indeed, using __repr__ worked fine
[23:13]<zjzdd>+fwiw, by convention eval(repr(foo)) reproduces foo (where practical, etc.)







