#python - Tue 27 Feb 2007 between 00:00 and 00:52

NY Lost Funds



arkaneseh, I dunno
you could argue it could be more clear
moldyassuming that would be against the rules of language
CHodappscrew it, let's all just learn Lisp
arkanesit's not uncommon to list conditions in order of application
in fact, it's a common legal principle
moldyif you first describe a general case and one sentence later a more specific case that contradicts the previous one, you don't assume the first one takes precedence
lividCHodapp: heh
arkanesbut when you list 2 specific cases and they contradict, then you either apply precedence or toss the whole thing out
Yhg1s_PyConI'm not sure where the confusion is
moldyif the first one is to take precedence, the second one is nonsense
arkanesand looking at behavior, it sure looks like precedence wins :P
Yhg1s_PyConisinstance() does the same thing for types and classes -- the terminology for classic classes is just a bit weird.
moldyarkanes: looking at the behaviour it's a doc bug
Yhg1s_PyConwhat is the actual problem here?
moldyYhg1s_PyCon: none
Yhg1s_PyConmoldy: so there isn't a doc bug?
moldyYhg1s_PyCon: IMHO, "With a type as second argument, return whether that is the object's type." is wrong
Yhg1s_PyConmoldy: why?
moldyYhg1s_PyCon: isinstance(2, object) # True
Yhg1s_PyCon: object is a type, but not the type of 2
Yhg1s_PyCon'object' is 2's type. so is 'int'.
moldyYhg1s_PyCon: ahh--ha.
whit537arkanes: got it
http://code.djangoproject.com/ticket/2315#comment:27
moldyYhg1s_PyCon: so objects can have several types, and type() just returns the most "inner" one?
whit537no US/Eastern on FreeBSD!
arkaneswhit537: damn liberals
Yhg1s_PyConhttp://en.wikipedia.org/wiki/Liskov_substitution_principle
whit537:-P
arkaneshmm
moldyYhg1s_PyCon: so one could say that objects can have several types?
then at least "the type" should be changed to "a type" in the docstring
arkanesany ideas on a straightforward way to add a __getattr__ hook to a package?
ironfroggyarkanes: still looking for that?
arkanesironfroggy: sure, if you have a good idea
ironfroggyyeah, you cant.
modules are sepcifically meant not to allow that kind of thing
they arent supposed to be extendable or customizable.
why do you think you want to do this?

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

IrcArchive

NY Lost Funds