X-Received: by 10.224.215.68 with SMTP id hd4mr8698269qab.5.1370878439445; Mon, 10 Jun 2013 08:33:59 -0700 (PDT) X-Received: by 10.49.35.68 with SMTP id f4mr469615qej.0.1370878439382; Mon, 10 Jun 2013 08:33:59 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!ch1no3421042qab.0!news-out.google.com!10ni1268qax.0!nntp.google.com!p1no3959442qaj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.python Date: Mon, 10 Jun 2013 08:33:59 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=192.30.208.242; posting-account=JmeKMgoAAABECkkccvjSCwzIdz7Y_ZwK NNTP-Posting-Host: 192.30.208.242 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0bfe7bee-3df2-4fb8-8aad-c2124792b8b6@googlegroups.com> Subject: py_compile vs. built-in compile, with __future__ From: dhyams Injection-Date: Mon, 10 Jun 2013 15:33:59 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.lang.python:47572 The built-in compile() function has a "flags" parameter that one can use to influence the "__future__" mechanism. However, py_compile.compile, which I'm using to byte-compile code, doesn't have an equivalent means to do this. Is this by design, or would this be considered a bug? I'm just wanting to do something like: import __future__ py_compile.compile("foobar.py",flags=__future__.CO_FUTURE_DIVISION) but there is no "flags" parameter to py_compile.compile(). It seems like this would be fixed just as easily as adding a "flags" parameter to py_compile.compile(), and then passing that through to the built-in compile(), which is called inside of py_compile.compile().