Limits on number of classes?

John Hunter jdhunter at ace.bsd.uchicago.edu
Sun Jun 13 18:57:01 CEST 2004


>>>>> "Kamilche" == Kamilche  <klachemin at home.com> writes:

    Kamilche> My design reqires hundreds of classes, maybe over a
    Kamilche> thousand. Can Python handle that? Will there be a speed
    Kamilche> hit? Just wondering if anyone had hit the limits of

Never heard of such a problem.  Here's a little script that creates
10000 classes; doesn't seem to strain python


for i in range(10000):
    exec('class C%d: pass'%i)

c = C1234()
c.x = 1
print c.x







More information about the Python-list mailing list