Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8171537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:29:34+00:00 2026-06-06T21:29:34+00:00

I am running Eclipse SDK v3.6 with PyDev v2.6 plugin on two PC, with

  • 0

I am running Eclipse SDK v3.6 with PyDev v2.6 plugin on two PC, with Linux and Windows.

I would like to pass a tuple as an argument, like:

foo = lambda (x,y): (y,x)
print (foo((1,2)))

This works on Linux and gives the correct result:

> (2,1)

On Windows it rises an error:

foo = lambda (x,y): (y,x)
             ^
SyntaxError: invalid syntax

How to solve the problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T21:29:36+00:00Added an answer on June 6, 2026 at 9:29 pm

    You are probably running Python 3.x on Windows, and Python 2.x on Linux. The ability to unpack tuple parameters was removed in Python 3: See PEP 3113.

    You can manually unpack the tuple instead, which would work on both Python 2.x and 3.x:

    foo = lambda xy: (xy[1],xy[0])
    

    Or:

    def foo(xy):
        x,y = xy
        return (y,x)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Eclipse GALILEO running on Linux Ubuntu with EPIC plugin to Run/Debug
I'm running Ubuntu 64-bit version 11.04, with Eclipse Linux 64-bit edition. The Android SDK
I've set up the Android SDK and Eclipse on my machine running Windows XP
Hi I am running eclipse sdk in windows and I am trying to compile
I am running Eclipse Pulsar with Java ME SDK 3.0. When I try running
I am working on a Windows XP Machine. When running AVDs out of Eclipse,
I'm running Eclipse pulsar with S60 SDK for j2me development and using LWUIT.jar but
I use Sonar 2.4.1, Maven 2, Eclipse SDK 3.5. Sonar is up and running
I am working in android SDK(Eclipse) platform 2.2 and I have been running through
I am writing Android apps using Eclipse + SDK 8, running at Android 2.2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.