no; the point was, it doesn't matter what name you give the class object; that only affects its __name__.  I wrote
 
class Foo: pass
class Bar = Foo
 
but I could just as easily have written
 
Bar = new.classobj('Foo', ...)
or
Bar = type('Foo', ...)
 
(which is the non-deprecated way of creating a class dynamically, btw)
 
On 1/5/06, limodou <[EMAIL PROTECTED]> wrote:
2006/1/5, Jonathan Ellis <[EMAIL PROTECTED]>:
> there's nothing magic about klass.__name__ being the same as the identifier
> you assign it to
>
> >>> class Foo: pass

In this case, you create a class named 'Foo' first. But if I use
new.classobj(), it need a class name parameter, so the function also
should be:

TClass = assign_class('TClass', table)

Using globals indeed a hack way, it's only my taste sometimes.

Thanks.
--
I like python!
My Blog: http://www.donews.net/limodou
NewEdit Maillist: http://groups.google.com/group/NewEdit


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&opclick
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users



--
Jonathan Ellis
http://spyced.blogspot.com

Reply via email to