On 5/20/2012 1:16 PM, Ian Kelly wrote:
On Sun, May 20, 2012 at 10:52 AM, e-mail mgbg25171
wrote:
There's a little forth program written in python here
#http://openbookproject.net/py4fun/forth/forth.py
I'm struggling to understand what these lines mean.
def rJnz (cod,p) : return (cod[p],p+1)[d
On Sun, May 20, 2012 at 10:52 AM, e-mail mgbg25171
wrote:
> There's a little forth program written in python here
> #http://openbookproject.net/py4fun/forth/forth.py
> I'm struggling to understand what these lines mean.
>
> def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
> def rJz (cod,p) : retu
On Mon, May 21, 2012 at 2:52 AM, e-mail mgbg25171
wrote:
> def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
> def rJz (cod,p) : return (p+1,cod[p])[ds.pop()==0]
>
> Specifically I'm stuck on what (code[p], followed by p+1 does inside the
> brackets
(cod[p],p+1) is a two-item tuple with [0] equal
There's a little forth program written in python here
#http://openbookproject.net/py4fun/forth/forth.py
I'm struggling to understand what these lines mean.
def rJnz (cod,p) : return (cod[p],p+1)[ds.pop()]
def rJz (cod,p) : return (p+1,cod[p])[ds.pop()==0]
Specifically I'm stuck on what (code[p],
Scott David Daniels <[EMAIL PROTECTED]> writes:
> At the risk of being thought of as beating a dead horse, this was a
> _great_ way to ask this question. [...]
> So, anyhow, thanks for taking the time to write your question properly.
Take that risk, please. There's enough lambasting of (and proba
J Rice wrote:
> I'm sorry for such a basic question, but I haven't been able to phrase
> a search that gets me an answer and my books are totally silent on
> this. I have seen a number of python function defs that take
> parameters of the form (**param1). Looks like a pointer... but my
> books on
Aahz wrote:
> Personally, I think it's a Good Idea to stick with the semi-standard
> names of *args and **kwargs to make searching easier...
I usually do stick to these names (since the I usually only use them
when forwarding arguments to another function, where such names are a
pretty good descri
On Mon, 20 Mar 2006, Ben Cartwright wrote:
> Dave Hansen wrote:
>> On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
>> [EMAIL PROTECTED] (Aahz) wrote:
>>> Personally, I think it's a Good Idea to stick with the semi-standard
>>> names of *args and **kwargs to make searching easier...
>>
>> Agreed
Dave Hansen wrote:
> On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
> [EMAIL PROTECTED] (Aahz) wrote:
> >Personally, I think it's a Good Idea to stick with the semi-standard
> >names of *args and **kwargs to make searching easier...
>
> Agreed (though "kwargs" kinda makes my skin crawl).
Coinc
On 20 Mar 2006 15:45:36 -0800 in comp.lang.python,
[EMAIL PROTECTED] (Aahz) wrote:
>In article <[EMAIL PROTECTED]>,
>Dave Hansen <[EMAIL PROTECTED]> wrote:
[...]
>>It's harder to explain than understand. Try playing with the
>>following function in the python interpreter:
>>
>> def test(a,b='b
In article <[EMAIL PROTECTED]>,
Dave Hansen <[EMAIL PROTECTED]> wrote:
>On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, "J Rice"
><[EMAIL PROTECTED]> wrote:
>>
>>I'm sorry for such a basic question, but I haven't been able to phrase
>>a search that gets me an answer and my books are totally sil
Wow, this is incredibly useful! I can understand why an introductory
book wouldn't make use of them, but I am really glad to know about
them. I can think of a bunch of ways to simply some code I have using
this.
--
http://mail.python.org/mailman/listinfo/python-list
J Rice wrote:
> I'm sorry for such a basic question, but I haven't been able to phrase
> a search that gets me an answer and my books are totally silent on
> this. I have seen a number of python function defs that take
> parameters of the form (**param1). Looks like a pointer... but my
> books on
in the parameter list, **param gets a dict of arguments that dont
correspond to somthing in the formal parameter list.
More & examples in the python docs:
http://docs.python.org/tut/node6.html#SECTION00672
--
Jordan T. Greenberg
--
http://mail.python.org/mailman/listinfo/python
On 20 Mar 2006 12:46:43 -0800 in comp.lang.python, "J Rice"
<[EMAIL PROTECTED]> wrote:
>I'm sorry for such a basic question, but I haven't been able to phrase
>a search that gets me an answer and my books are totally silent on
>this. I have seen a number of python function defs that take
>paramet
I'm sorry for such a basic question, but I haven't been able to phrase
a search that gets me an answer and my books are totally silent on
this. I have seen a number of python function defs that take
parameters of the form (**param1). Looks like a pointer... but my
books on python (basic as they a
16 matches
Mail list logo