| arkanes | eh, I dunno you could argue it could be more clear |
| moldy | assuming that would be against the rules of language |
| CHodapp | screw it, let's all just learn Lisp |
| arkanes | it's not uncommon to list conditions in order of application in fact, it's a common legal principle |
| moldy | if 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 |
| livid | CHodapp: heh |
| arkanes | but when you list 2 specific cases and they contradict, then you either apply precedence or toss the whole thing out |
| Yhg1s_PyCon | I'm not sure where the confusion is |
| moldy | if the first one is to take precedence, the second one is nonsense |
| arkanes | and looking at behavior, it sure looks like precedence wins :P |
| Yhg1s_PyCon | isinstance() does the same thing for types and classes -- the terminology for classic classes is just a bit weird. |
| moldy | arkanes: looking at the behaviour it's a doc bug |
| Yhg1s_PyCon | what is the actual problem here? |
| moldy | Yhg1s_PyCon: none |
| Yhg1s_PyCon | moldy: so there isn't a doc bug? |
| moldy | Yhg1s_PyCon: IMHO, "With a type as second argument, return whether that is the object's type." is wrong |
| Yhg1s_PyCon | moldy: why? |
| moldy | Yhg1s_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'. |
| moldy | Yhg1s_PyCon: ahh--ha. |
| whit537 | arkanes: got it http://code.djangoproject.com/ticket/2315#comment:27 |
| moldy | Yhg1s_PyCon: so objects can have several types, and type() just returns the most "inner" one? |
| whit537 | no US/Eastern on FreeBSD! |
| arkanes | whit537: damn liberals |
| Yhg1s_PyCon | http://en.wikipedia.org/wiki/Liskov_substitution_principle |
| whit537 | :-P |
| arkanes | hmm |
| moldy | Yhg1s_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 |
| arkanes | any ideas on a straightforward way to add a __getattr__ hook to a package? |
| ironfroggy | arkanes: still looking for that? |
| arkanes | ironfroggy: sure, if you have a good idea |
| ironfroggy | yeah, 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? |