Revision: 3963 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3963&view=rev Author: mdboom Date: 2007-10-18 10:40:30 -0700 (Thu, 18 Oct 2007)
Log Message: ----------- Major speedup in PDF backend by using hasattr() rather than 'in dir()' Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py Modified: trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-10-18 15:06:49 UTC (rev 3962) +++ trunk/matplotlib/lib/matplotlib/backends/backend_pdf.py 2007-10-18 17:40:30 UTC (rev 3963) @@ -105,7 +105,7 @@ """Map Python objects to PDF syntax.""" # Some objects defined later have their own pdfRepr method. - if 'pdfRepr' in dir(obj): + if hasattr(obj, 'pdfRepr'): return obj.pdfRepr() # Floats. PDF does not have exponential notation (1.0e-10) so we This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- 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/ _______________________________________________ Matplotlib-checkins mailing list Matplotlib-checkins@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins