Hi Michael,

still, you have different instances in your example. The only problem
in your example is, that the garbage collector throws away the
document instance immediately again. Check this out:

    from pyx import *

    class slides:
        def document(self):
            d = document.document()
            return d

    l = []
    s = slides()
    for i in range(4):
        d = s.document()
        print d
        l.append(d)

... and you'll get diffent instances. Still, you may have some kind of
a problem ... and there might be bugs. But as far as your example is
concerned, everything is fine.

Best,

André


On 01.08.07, Michael SCHINDLER wrote:
> Salut,
> 
> I have a problem with creating different instances of the pyx.document
> class: I would like to have a "slides" class which writes out a number
> of slides in different ways (for beamer presentations, for handouts,
> with different sizes).
> 
> Unfortunately, when I create several pyx.document instances, they are
> all the same (having the same memory address)! See the enclosed
> minimal example. Is there an explanation for this behaviour?
> 
> # -------------------------
> from pyx import *
> 
> class slides:
>     def document(self):
>         d = document.document()
>         return d
> 
> s = slides()
> for i in range(4):
>     print s.document()
> # -------------------------
> 
> Michael.
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user

André

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to