Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'xml,': 0.05; 'subject:Python': 0.06; 'bits': 0.09; 'forms,': 0.09; 'pgp': 0.09; 'xml.': 0.09; 'python': 0.11; 'wrote': 0.14; 'question.': 0.14; '(gnu/linux)': 0.16; '-----begin': 0.16; '-----end': 0.16; 'gnupg': 0.16; 'hash:': 0.16; 'sha1': 0.16; 'language': 0.16; 'wrote:': 0.18; 'message-----': 0.19; 'seems': 0.21; 'code,': 0.22; 'header:User-Agent:1': 0.23; 'helper': 0.24; 'pass': 0.26; 'signed': 0.27; 'header:In-Reply-To:1': 0.27; 'rest': 0.29; 'thus': 0.29; 'xml': 0.29; '(which': 0.31; 'code': 0.31; 'skip:i 60': 0.31; 'figure': 0.32; 'classes': 0.35; 'common': 0.35; 'but': 0.35; 'there': 0.35; 'functions.': 0.36; 'right?': 0.36; 'version:': 0.36; 'useful': 0.36; 'wrong': 0.37; 'problems': 0.38; 'easiest': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'full': 0.61; 'from:charset:utf-8': 0.61; 'simple': 0.61; 'header:Message-Id:1': 0.63; 'more': 0.64; 'rendering': 0.68; 'expressive': 0.84; 'scratch,': 0.84 To: python-list@python.org Subject: Re: Python declarative In-Reply-To: =?UTF-8?Q?=3CCAPTjJmo=2BEuY439wB0C8or=2BZAcYeNR844HAKwL3i2?= =?UTF-8?Q?=2B55dDE8LNA=40mail=2Egmail=2Ecom=3E?= References: <8fde6d34-47c5-49a1-a6d0-9ffe3df2d401@googlegroups.com> From: =?UTF-8?Q?Mat=C4=9Bj?= Cepl Date: Fri, 24 Jan 2014 17:28:41 +0100 User-Agent: slrn/1.0.1 (Linux) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1390580930 news.xs4all.nl 2970 [2001:888:2000:d::a6]:52161 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64692 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-01-24, 11:18 GMT, you wrote: > Write your rendering engine as a few simple helper functions, > and then put all the rest in as code instead of XML. The > easiest way to go about it is to write three forms, from > scratch, and then look at the common parts and figure out > which bits can go into helper functions. Perhaps what's missing is full acknowledgment that Python has dual-inheritance and thus it can have mixin classes (which seems to me to be the only useful use of dual inheritance). You know you can have mixins in Python, right? Also, I wrote my share of XML parsing/writing code, but more and more I am persuaded that if the answer is “XML” then there is some wrong with the question. Python is a way more expressive language than XML, so it is almost always more useful to write in Python, than to pass any problems to XML. Matěj -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iD8DBQFS4pS54J/vJdlkhKwRApdcAJ48PRgDz6ccnq1YFD9zx8EDDH3JjgCghU2x 3CV+D0LvquzgYRux2GslZ0E= =Y3/F -----END PGP SIGNATURE-----