Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'bits': 0.07; 'properly.': 0.07; 'string;': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:module': 0.09; 'properly': 0.15; 'handling.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:instance': 0.16; 'wrote:': 0.16; 'string,': 0.18; 'typical': 0.18; 'load': 0.20; 'cc:2**0': 0.21; 'trying': 0.22; '2015': 0.23; 'import': 0.24; 'seems': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'specify': 0.27; "doesn't": 0.28; "i'm": 0.29; 'relies': 0.29; 'e.g.': 0.31; 'fri,': 0.31; "can't": 0.32; "d'aprano": 0.33; 'steven': 0.33; 'surely': 0.33; 'to:addr:python-list': 0.35; 'skip:> 10': 0.35; 'being': 0.36; 'subject:: ': 0.37; 'received:org': 0.38; 'say': 0.38; 'pm,': 0.39; 'method': 0.39; 'to:addr:python.org': 0.39; 'data': 0.40; 'why': 0.40; 'here.': 0.61; 'skip:u 10': 0.62; 'afraid': 0.63; 'overcome': 0.72; 'useful.': 0.72; 'received:109': 0.75; 'becker': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robin Becker Subject: Re: instance as module Date: Mon, 22 Jun 2015 10:24:22 +0100 References: <55851538$0$1667$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Steven D'Aprano X-Gmane-NNTP-Posting-Host: 109.174.168.73 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <55851538$0$1667$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1434965069 news.xs4all.nl 2909 [2001:888:2000:d::a6]:47897 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:92998 On 20/06/2015 08:24, Steven D'Aprano wrote: > On Fri, 19 Jun 2015 07:29 pm, Robin Becker wrote: > >> I'm trying to overcome a recursive import issue in reportlab. .......... > > I'm afraid I don't understand what you are trying to say here. Why can't the > user just set up "such a default" e.g. canvas_basefontname. Surely that is > a string, e.g. "Comic Sans". > > Why will a recursive import occur? If the user doesn't want a recursive > import, they need only ensure that they don't import anything that relies > on rl_config. > >............ I'm afraid this is a failure on the part of reportlab's font handling. For almost all user access the font is indeed a string; unfortunately we need also to load data for a typical font (eg arial) so that it can be used properly. To load the data properly requires other bits of reportlab which use rl_config. Being able to specify both the font token to use and the method of initialization simultaneously seems useful. -- Robin Becker