2008-6-1

00:51 jacobkm
No worries - it's a fine point.
00:51 jacobkm
Gulopine: where?
00:51 Gulopine
if a model contains "class Meta(object):" you'll find nice errors about invalid meta options
00:52 jacobkm
ew
00:52 Gulopine
the was class Admin: but i don't actually know for sure if that's true or not
00:52 Gulopine
and that's going away "soon" anyway
00:52 Gulopine
i can file a bug if you like, but i hadn't bothered because the docs all show old-style classes
00:52 jacobkm
that's not really a big deal, though, since that class gets swizzled into an Options instance.
00:53 jacobkm
But it wouldn't be a bad idea to fix it just in case someone wants to be all propper :)
00:53 Gulopine
it does get a little annoying in my dynamic model examples though
00:53 Gulopine
since i can't use type() to create an old-style class :)
00:53 jacobkm
Probably whatever's breaking there is gonna break on 3k too, so worth figuring out what the deal is.
00:53 Alex_Gaynor
Won't that be an issue in 3.0 once newstyle is implicit?
00:53 jacobkm
Alex_Gaynor: Jinx
00:53 Gulopine
it's a simple fix, really
00:53 Gulopine
just two extra lines
00:53 Gulopine
i'd be happy to file it
00:54 jacobkm
Yup, make it so.
00:54 Gulopine
the joys of writing a book about all these internals
00:54 Gulopine
i should actually make a list of all the bugs i've filed as a result of the book
00:54 Gulopine
so far it's just a handful, but it's still early :)
00:54 Alex_Gaynor
Then you can write the sequel about fixing them
00:54 Alex_Gaynor
I almost wrote that SQL :P
00:55 Gulopine
they're already fixed :)
01:05 Gulopine
hrm, although ... how robust do you want it? :)
01:05 Gulopine
just in case python3k adds more __*__ attributes to classes, i mean
01:06 jacobkm
You're talking about validating the fields that are allowed in Meta?
01:06 Gulopine
yeah
01:07 Gulopine
i was just gonna add in checks for __dict__ and __weakref__, but if there might be more later, maybe it's worth future-proofing
01:07 Alex_Gaynor
We could have Meta inherit something and just use __slots__
01:07 Gulopine
...
01:07 jacobkm
Alex_Gaynor: that would require changing how people declare it, so, no.
01:07 jacobkm
Gulopine: just let anything _* slide.
01:08 Alex_Gaynor
I know, I was just presenting the option :D
01:08 Gulopine
oh, okay
01:08 Gulopine
that's easy enough
01:08 Gulopine
i was gonna leave it at __*__
01:08 jacobkm
nah, _* is private enough :)
01:09 Gulopine
true
01:09 Gulopine
should those be just ignored entirely, or be tacked onto _meta?
01:09 Gulopine
(reaching too far)
01:09 Gulopine
nvm
01:10 jacobkm
just ignore for now, but I can read your mind: I totally want a mechanism for allowing custom stuff in _meta, too :)
01:13 Gulopine
hehe
01:14 Gulopine
you know me so well :)
01:14 Gulopine
thus far, i appreciate the idiot-proofing though
01:31 Gulopine
yay 4 bug hunting
01:57 fijal
ah, and besides
01:57 fijal
the stuff with str + unicode_subclass calling __radd__ of unicode_subclass is against official spec
01:57 fijal
I don't really care, just telling
02:27 jacobkm
fijal: where's that?
02:40 fijal
jacobkm: safestring
02:40 fijal
or auto-escape string
02:40 fijal
something like that
Page 2 of 2   ← Previous  (154 total)