#python - Tue 27 Mar 2007 between 00:00 and 00:07

NY Lost Funds



TFKylesgeigerbot, triplah_w: if it just encodes all unicode paramaters sent to it maybe, but I think it'd be a bit hard to make a decorator that actually modified the function
marienzwhy would it have to modify the function
it'd just have to do, erm, sec, hacking it up
TFKyleto encode all unicode objects in it
marienzit can't do that, but it can do it to all args
sgeigerbotTFKyle: Well, I tkhink the point of decorators is that the function isnt' modified.
marienzisn't that what the question is?
sgeigerbotTFKyle: he just wants parameters that are unicode.
TFKylenot sure
marienztriplah_w: what's the question again? :)
TFKyleah, should've worded it better, I mean if you wanted to encode all unicodes in it
pfnhmm, ok, next question about python, can individual .py files in a "package" be split up amongst different directories?
marienzpfn: you don't normally want to do that, imho.
pfn: you *can* do that (by modifying __path__ in the __init__ of the package)
pfnsay I have trac.ticket.*, can I put SomeClass into /my/path/lib/trac/ticket/SomeClass, and the rest in /usr/lib/python/.../trac/ticket/*
triplah_wmarienz: a decorator that encodes everything as utf-8
TFKylesgeigerbot: would need a huge amount of adoption to make much difference then I imagine
marienzpfn: but I disagree with the most common use case for that I have seen.
triplah_walthough i'm guessing that writing a helper function would do the same thing
marienztriplah_w: define "everything"
triplah_w: if "everything" means "all args and the return value" it is easy.
triplah_wmarienz: sorry i cant do that, for me its just strings
yep
marienztriplah_w: ok, what direction? the func gets passed unicode and you want it to get passed strings, or the other way around?
meh, I'll just hack one up
actionTFKyle figured triplah_w meant when that function calls things, to have it .encode on unicode objects
TFKylefigured triplah_w meant when that function calls things, to have it .encode on unicode objects
triplah_wyeah
pfnmarienz, and what if I wanted to support my above use-case? basically have locally modified copies of the .py in the /my/path and still being able to use "pristine" copies in /usr/lib/...
triplah_wand viceversa for reading from files etc, to decode everything
so no matter what your app gets datawise - it gets converted to utf-8
marienzpfn: in a package: just copy it, imho.
pfncopy the entire package? hmm
TFKyle(which would require rewriting the function or some sort of weird stuff I think)
pfnI suppose I can try that
TFKylefile reading wouldn't be that hard I guess, monkeypatching file.read to do it
guess py3k's io library'd be better though
Ballothrash thrash thrash thrash...
actionBallo needs to reinstall
Balloneeds to reinstall
marienztriplah_w: http://rafb.net/p/XiUfjp14.html or something, but don't do it, it's a hack!
also untested :)

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 

IrcArchive

NY Lost Funds