David Griffin | 31 Jul 17:32

Using __builtin__compile()

Can anyone point me to a place where I can read about the arguments
required to this method.

(I want to cache compiled scripts to use in an embedded interpreter).

I have read the javadoc, bought an O'Reilly book, but so far I still
only know this:

public static PyCode compile(java.lang.String data,
                             java.lang.String filename,
                             java.lang.String type)

that is, I have not found any info as to what "type" is.

Perhaps it works with either a String or a .py file and the 3rd
parameter tells it what you are supplying ?  (with the 1st or 2nd
parameter being unused ?).

Anyone suggest a weblink where I can read some more ?

Thanks in advance.

David Griffin
(finally done lurking).

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)

Nicholas Riley | 31 Jul 18:21

Re: Using __builtin__compile()

In article 
<76e0d22a0807310832n7a1a8c89y5f0fd39fdf68b853 <at> mail.gmail.com>,
 "David Griffin" <gripfin <at> gmail.com> wrote:

> that is, I have not found any info as to what "type" is.
> 
> Perhaps it works with either a String or a .py file and the 3rd
> parameter tells it what you are supplying ?  (with the 1st or 2nd
> parameter being unused ?).
> 
> Anyone suggest a weblink where I can read some more ?

This is an implementation of a Python function, and is as such 
documented in the Python reference manual:

   http://docs.python.org/lib/built-in-funcs.html

It seems nobody can agree on the name for this argument; Jython calls it 
"type", the Python docs call it "kind" and the docstring calls it "mode".

If you're invoking Jython from Java code, you may find Py.compile_flags 
a more convenient interface to use (cast the result to PyCode if 
necessary).
--

-- 
Nicholas Riley <njriley <at> uiuc.edu>

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
(Continue reading)

David Griffin | 31 Jul 19:03

Re: Using __builtin__compile()

Ah.  Makes sense now.  Thanks

2008/7/31 Nicholas Riley <njriley <at> uiuc.edu>:

> This is an implementation of a Python function, and is as such
> documented in the Python reference manual:
>
>   http://docs.python.org/lib/built-in-funcs.html
>
> Nicholas Riley <njriley <at> uiuc.edu>
>

David Griffin

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Frank Wierzbicki | 22 Aug 16:51

Re: Using __builtin__compile()

On Thu, Jul 31, 2008 at 12:21 PM, Nicholas Riley <njriley <at> uiuc.edu> wrote:
> In article
> <76e0d22a0807310832n7a1a8c89y5f0fd39fdf68b853 <at> mail.gmail.com>,
>  "David Griffin" <gripfin <at> gmail.com> wrote:
>
>> that is, I have not found any info as to what "type" is.
>>
>> Perhaps it works with either a String or a .py file and the 3rd
>> parameter tells it what you are supplying ?  (with the 1st or 2nd
>> parameter being unused ?).
>>
>> Anyone suggest a weblink where I can read some more ?
>
> This is an implementation of a Python function, and is as such
> documented in the Python reference manual:
>
>   http://docs.python.org/lib/built-in-funcs.html
>
> It seems nobody can agree on the name for this argument; Jython calls it
> "type", the Python docs call it "kind" and the docstring calls it "mode".
I think I'll make this "kind" in Jython to be consistent with Python
source code -- we call it "kind" in other parts of Jython anyway.

-Frank

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
(Continue reading)


Gmane