Nick,

> It's never 'safe' to mess with the internals of Python like this. As a rule,
> if you're trying to change the class of an existing object, that's a code
> smell, and you should almost certainly be implementing it differently, such

Hi. As a rule, when someone uses the term "code smell", that's a
"cliche smell".

Google bundles django with AppEngine, and django messes with the
internals of Python like crazy, so Google hopefully does think it's
safe in some cases.

I want to put some data into the datastore. Depending on the value of
that data, I want it to map to a different class when I get it back.
Changing the __class__ attribute currently works. I posted this
question for two reasons:

 - to find out whether or not this approach was likely to break in
some cases or with future versions of DataStore API.
 - because changing __class__ feels hackish and I was hoping someone
might suggest a better approach

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to