Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.03; 'subject:Django': 0.03; '2.7': 0.04; 'subject:Python': 0.06; 'concurrently': 0.07; 'django,': 0.07; 'sanity': 0.07; 'python': 0.08; 'callable.': 0.09; 'exceptions': 0.09; 'executes': 0.09; 'okay': 0.09; 'programmer': 0.10; 'am,': 0.12; 'code?': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'invoking': 0.16; 'parks': 0.16; 'py3': 0.16; 'side.': 0.16; 'subject:Supporting': 0.16; 'travis': 0.16; 'unpacking': 0.16; 'written': 0.17; 'wrote:': 0.18; 'received:209.85.210.174': 0.18; 'received:mail-iy0-f174.google.com': 0.18; 'accepting': 0.19; 'possibly': 0.21; 'header:In-Reply-To:1': 0.23; 'code': 0.25; 'parameters': 0.25; 'separate': 0.28; 'bit': 0.28; 'tried': 0.28; 'django': 0.29; 'message-id:@mail.gmail.com': 0.29; 'module': 0.30; 'logic': 0.30; 'sun,': 0.30; 'terminate': 0.30; 'nov': 0.31; 'values': 0.31; 'anyone': 0.31; 'objects': 0.32; 'to:addr:python- list': 0.32; 'source': 0.33; 'running': 0.35; '...': 0.36; 'pull': 0.36; 'but': 0.37; 'using': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'either': 0.39; 'help': 0.39; 'subject:: ': 0.39; 'might': 0.39; 'to:addr:python.org': 0.39; 'data': 0.40; 'files': 0.40; 'received:209': 0.40; '2011': 0.62; 'cost': 0.63; 'ever': 0.65; 'business': 0.70; 'fun?': 0.73; 'time?': 0.73; 'tricky': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=RAqZiitThd8r0NoDv6du5qx2u+EsYMi39NCfODoYr9o=; b=otGxw26gKwOTnIzdO1Cspf9f31zC/tf+oUVO5Zm3DtNB5ejy5ZsUaB2PkXh9NU5QnX 6qwzNGif/gzj59G+MYzkqvvYC1H0RlHEguUDyklwbDd2jez7JFbE9es6XRZmi6qOzkj7 CWXg41znALdbBQKQPFCP3Q1JRBzUpExFNMCb4= MIME-Version: 1.0 In-Reply-To: <1f9f9361-8278-4ae6-8d4d-5fd09b0fd800@hc5g2000vbb.googlegroups.com> References: <1f9f9361-8278-4ae6-8d4d-5fd09b0fd800@hc5g2000vbb.googlegroups.com> Date: Sun, 6 Nov 2011 09:09:25 +1100 Subject: Re: Python ORMs Supporting POPOs and Substituting Layers in Django From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320530968 news.xs4all.nl 6972 [2001:888:2000:d::a6]:38471 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15368 On Sun, Nov 6, 2011 at 7:11 AM, Travis Parks wrote: > Finally, I wanted to ask whether anyone has tried having Django call > out to Python 3 routines. I am okay using Python 2.7 in Django, if I > can have the controllers call business logic implemented in Python 3, > accepting POPOs from the data layer. What you're going to have is completely separate processes; either invoking Python3 and having it terminate after one action, or keeping it running concurrently and passing data between them. Has anyone ever extended AND embedded Python at the same time? Written a Python module that ... executes Python code? Might be a bit tricky, but possibly isolating the Py2 and Py3 code into different C source files would help conserve programmer sanity (at the possible cost of performance). Would be a tricky thing to juggle, but if you can pull it off, you'd be able to - effectively - have a module in Django that's written in Python 3, and directly callable. Propagating parameters and return values would be a matter of unpacking them into C objects and repacking them on the other side. Propagating exceptions would be.... fun? ChrisA