#python - Sun 18 Feb 2007 between 13:49 and 14:06

NY Lost Funds



Zaba_what is a handler script for mod_python? how should i configure mod_python?
jojoman02ayaz, i only need the even values (or odd values) to be copied to the new list
ayaz, even tho it's not really even/odd since list numbering starts with 0...
ayazjojoman02: you could use map() or list comprehensions to do that
marujojoman02: b = a[::2]
ayazor filter(), in fact
maruor a[1::2]
jojoman02maru, thankz ,and for odd values i use?
Tweyjojoman02: a[1::2]
jojoman02twey, i get it thankz..
ehirdcan i super() in a new __import__?
Tweyehird: No, store the old __import__ somewhere safe
ehirdwouldn't old_import = __import__ inherit all new changes?
VelosoPerhaps learning how the Python object model works should come before overriding import :)
TweyHeh
ehird:p
i've never needed to override a method or object, so, eh.
ivan`also __builtins__.__import__
it takes 4 arguments
Velosoehird: Creating a new function with def creates a new function object and binds it to the name you provided. It does not modify any existing object.
ehirdthat isn't what i meant
f = 1; x = f; x = 2; <-- I would have thought f would now = 2
ivan`integers are copied
try that with a list though
easytigeranyone use PIDE? what dependencies does it ned and how do i install them.
sreeramivan`: it is no different with a list... a = [1]; b = a; b = [2]... a is still [1] at this point
marubut try... a = [1]; b = a; b.append(2)
ivan`ah, right
ehirdhmm, puzzling
Velosoehird: It's best to think of objects existing completely independently of their names. An assignment makes a name point to a particular object, but that's it
ehirdif i want this to work i have to start it at the end of the files...
but i want it disableable by setting a variable in the module
sreeramehird: people mistakenly conflate variables and objects... a variable is not an object, it is just a binding from a name to some object... and assignment just changes the binding, so the name will refer to a different object
ehird... brain freeze!
sreeram: yeah i guess
VelosoAfter f=1, x=f, both x and f are pointing to the same object, the integer 1
Then after x=2, you are pointing x at a different object
f is still pointing at the same thing as before
ehirdSo, essentially, python is always passbyvalue
sreeramehird: yep

Page: 2 9 16 23 30 37 

IrcArchive

NY Lost Funds