Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
tuple unpacking in argument list.
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Chris Barker  
View profile  
 More options Nov 8 2012, 7:52 pm
From: Chris Barker <chris.bar...@noaa.gov>
Date: Thu, 8 Nov 2012 16:51:40 -0800
Local: Thurs, Nov 8 2012 7:51 pm
Subject: tuple unpacking in argument list.
Folks,

I am setting out to Cythonize a function, and found that Cython does
not appear to support tuple unpacking in function arguments. This is
perfectly legal Python:

def test_tuple_unpack((x_1, y_1), (x_2, y_2)):
        print x_1, y_1, x_2, y_2

but when I try to run Cython on it:

$ cython tuple_unpack_args.pyx

Error compiling Cython file:
------------------------------------------------------------
...
def test_nested_tuples((x_1, y_1), (x_2, y_2)):
                          ^
------------------------------------------------------------

tuple_unpack_args.pyx:1:27: Expected ')', found ','

$ cython --version
Cython version 0.17.1

Whether we want to support this I don't know, but if the goal is to be
able to compile all legal python, then this is a missing feature.

-Chris

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Bar...@noaa.gov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Behnel  
View profile  
 More options Nov 9 2012, 1:57 am
From: Stefan Behnel <stefan...@behnel.de>
Date: Fri, 09 Nov 2012 07:57:03 +0100
Local: Fri, Nov 9 2012 1:57 am
Subject: Re: [cython-users] tuple unpacking in argument list.
Chris Barker, 09.11.2012 01:51:

> I am setting out to Cythonize a function, and found that Cython does
> not appear to support tuple unpacking in function arguments. This is
> perfectly legal Python:

Python 2, to be exact.

Well, it's a known limitation at least.

http://trac.cython.org/cython_trac/ticket/692

Given that it's a dead feature that requires a dedicated, non-trivial
implementation (unnamed function arguments) but that is very easy to work
around, there hasn't been any move to support it yet.

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Barker  
View profile  
 More options Nov 9 2012, 2:34 pm
From: Chris Barker <chris.bar...@noaa.gov>
Date: Fri, 9 Nov 2012 11:33:49 -0800
Local: Fri, Nov 9 2012 2:33 pm
Subject: Re: [cython-users] tuple unpacking in argument list.

On Thu, Nov 8, 2012 at 10:57 PM, Stefan Behnel <stefan...@behnel.de> wrote:
>> not appear to support tuple unpacking in function arguments. This is
>> perfectly legal Python:

> Python 2, to be exact.

I see -- I've paid far too little attention to Python 3 -- I didn't
realize this was depreciated.

> Well, it's a known limitation at least.

> http://trac.cython.org/cython_trac/ticket/692

I should have searched the tickets, clearly!

But maybe it should be mentioned here:

http://docs.cython.org/src/userguide/limitations.html

(which has nothing in it now!)

or at least the ticket could be assigned to the "Python Semantics"
component, so it will show up here:

http://trac.cython.org/cython_trac/query?status=assigned&status=new&s...

Should I do that? I _think_ I have TRAC access.

> Given that it's a dead feature that requires a dedicated, non-trivial
> implementation (unnamed function arguments) but that is very easy to work
> around, there hasn't been any move to support it yet.

Fair enough.

-thx.
  -Chris

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Bar...@noaa.gov


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Behnel  
View profile  
 More options Nov 9 2012, 2:42 pm
From: Stefan Behnel <stefan...@behnel.de>
Date: Fri, 09 Nov 2012 20:42:00 +0100
Subject: Re: [cython-users] tuple unpacking in argument list.
Chris Barker, 09.11.2012 20:33:

AFAIR, there was some content a while ago, but it became outdated and was
removed, likely around 0.15 when the last major Python features went in.

> or at least the ticket could be assigned to the "Python Semantics"
> component, so it will show up here:

> http://trac.cython.org/cython_trac/query?status=assigned&status=new&s...

Good call, I've changed the "Component".

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »