Skip to content

Instantly share code, notes, and snippets.

@btbytes
Created June 25, 2010 17:31
Show Gist options
  • Select an option

  • Save btbytes/453158 to your computer and use it in GitHub Desktop.

Select an option

Save btbytes/453158 to your computer and use it in GitHub Desktop.

Indpy June 2010 meeting notes

Python 3.1 presentation

Guido at OSCON 2002. "python regrets" print, integer division, xrange, raw_input, backticks etc.,

3.1 >> Feature FREEEEEEEZE

top 10 things..

  1. Sets built in. frozen sets. immutable.

  2. Exceptions

except as e.

  1. Stricter comparisons 3 < "1" # true in python 2.x 3 < ">"1" # unorderable types exception. "In the face of ambiguity refuse the temptation to guess"

  2. string formatting. format() method on strings.

  3. advanced unpacking.

    x = (1,2,3,4,5) a, *b, c = x a -> 1 b -> [2,3,4] c -> 5

  4. dictionary (and set) comprehensions new_dict = {row[0]: row[1:] for row in results}

bytes do not have many of the string methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment