Identi.ca Identi.ca
  • Login
  • Public

    • Public
    • Groups
    • Featured
    • Popular

Conversation

Notices

  1. Evgeni Golov Evgeni Golov Python

    Hey !python, if your function needs to return two values, do you return a tuple or a list?

    about 9 months ago from web at Düsseldorf, North Rhine-Westphalia, Germany
    • Florian Ludwig Florian Ludwig

      @evgeni a = 1,2; type(a) == <type 'tuple'>

      about 9 months ago
    • Ray Bachas Ray Bachas

      @evgeni tuple, its safer :)

      about 9 months ago
    • Space Hobo Space Hobo Python

      @evgeni idiomatic !python is to return a tuple, typically bare of parens: "return x, y, z" and elsewhere "a, b, c = foo()"

      about 9 months ago
    • Mats Rauhala Mats Rauhala

      @evgeni I'd recommend a tuple, especially if it returns exactly two values.

      about 9 months ago

Site notice

  • API
  • Status

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Identi.ca is a microblogging service brought to you by Status.net. It runs the StatusNet microblogging software, version 1.1.0-alpha1, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Identi.ca content and data are available under the Creative Commons Attribution 3.0 license.

Switch to mobile site layout.

Built in Montreal