State of the Python Union OSCON Portland, Oregon July 29, 2004 Guido van Rossum Elemental Security, Inc.

Slides:



Advertisements
Similar presentations
Python at Elemental Security EuroPython - June 29, 2005 Guido van Rossum Elemental Security, Inc.
Advertisements

Chapter 4 Loops Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved
Simplifications of Context-Free Grammars
2. Getting Started Heejin Park College of Information and Communications Hanyang University.
Chapter 5: Control Structures II (Repetition)
Advanced Piloting Cruise Plot.
Chapter 6 Writing a Program
Copyright © 2003 Pearson Education, Inc. Slide 8-1 Created by Cheryl M. Hughes, Harvard University Extension School Cambridge, MA The Web Wizards Guide.
Chapter 1 The Study of Body Function Image PowerPoint
"The State of the Python Union" Python10 - Alexandria, VA - February 7, 2002 Guido van Rossum Director, PythonLabs at Zope Corporation
Why I Invented Python EuroPython – June 27, 2005 Guido van Rossum Elemental Security, Inc.
The State of the Python Union BDFL PyCon – March 24, 2005 Guido van Rossum Elemental Security, Inc.
Python Regrets OSCON, July 25, 2002
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
© 2010 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 5: Repetition and Loop Statements Problem Solving & Program.
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
11 Copyright © 2005, Oracle. All rights reserved. Using Arrays and Collections.
8 Copyright © 2005, Oracle. All rights reserved. Creating the Web Tier: JavaServer Pages.
1 State Wildlife Action Plans Wiki: Business Transformation Tutorial Brand Niemann July 5, 2008
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Programming Language Concepts
Mike Scott University of Texas at Austin
Integrify 5.0 Tutorial : Creating a New Process
CSC 270 Nov. 22, 2005 Last Day of Scheme Dr. Stephen Bloch
Lilian Blot Announcements Teaching Evaluation Form week 9 practical session Formative Assessment week 10 during usual practical sessions group 1 Friday.
Mehdi Naghavi Spring 1386 Operating Systems Mehdi Naghavi Spring 1386.
Randomized Algorithms Randomized Algorithms CS648 1.
Lilian Blot TO PROGRAMMING & PYTHON Introduction Autumn 2012 TPOP 1.
Python Mini-Course University of Oklahoma Department of Psychology
Modern Programming Languages, 2nd ed.
Lilian Blot Recursion Autumn 2012 TPOP 1. Lilian Blot Recursion Autumn 2012 TPOP 2.
Semantic Analysis and Symbol Tables
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
VOORBLAD.
1 public class Newton { public static double sqrt(double c) { double epsilon = 1E-15; if (c < 0) return Double.NaN; double t = c; while (Math.abs(t - c/t)
31242/32549 Advanced Internet Programming Advanced Java Programming
© 2012 National Heart Foundation of Australia. Slide 2.
Lilian Blot PART V: FUNCTIONS Core elements Autumn 2013 TPOP 1.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 4 Loops.
While Loop Lesson CS1313 Spring while Loop Outline 1.while Loop Outline 2.while Loop Example #1 3.while Loop Example #2 4.while Loop Example #3.
Executional Architecture
Chapter 5 Test Review Sections 5-1 through 5-4.
 2000 Prentice Hall, Inc. All rights reserved. Chapter 14 - Advanced C Topics Outline 14.1Introduction 14.2Redirecting Input/Output on UNIX and DOS Systems.
1 Variables and Data Types. 2 Variable Definition a location in memory, referenced by a name (identifier), where data of a given type can be stored, changed,
Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.
25 seconds left…...
1 Object Oriented Programming Ras Bodik, Thibaud Hottelier, James Ide UC Berkeley CS164: Introduction to Programming Languages and Compilers Fall 2010.
Januar MDMDFSSMDMDFSSS
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
Lilian Blot CORE ELEMENTS SELECTION & FUNCTIONS Lecture 3 Autumn 2014 TPOP 1.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
©2004 Brooks/Cole FIGURES FOR CHAPTER 12 REGISTERS AND COUNTERS Click the mouse to move to the next page. Use the ESC key to exit this chapter. This chapter.
PSSA Preparation.
Python Mini-Course University of Oklahoma Department of Psychology Day 1 – Lesson 4 Beginning Functions 4/5/09 Python Mini-Course: Day 1 - Lesson 4 1.
Claus Brabrand, UFPE, Brazil Aug 11, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 13 – Salary Survey Application: Introducing.
Chapter 8 Improving the User Interface
User Defined Functions Lesson 1 CS1313 Fall User Defined Functions 1 Outline 1.User Defined Functions 1 Outline 2.Standard Library Not Enough #1.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
CS1022 Computer Programming & Principles
12-Apr-15 Analysis of Algorithms. 2 Time and space To analyze an algorithm means: developing a formula for predicting how fast an algorithm is, based.
L6:CSC © Dr. Basheer M. Nasef Lecture #6 By Dr. Basheer M. Nasef.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 3 Loops.
Presentation transcript:

State of the Python Union OSCON Portland, Oregon July 29, 2004 Guido van Rossum Elemental Security, Inc.

July 29, 2004© 2004 Guido van Rossum 2

July 29, 2004© 2004 Guido van Rossum 3 Keynote Overview PSF Grants Release status Python 2.4: –Generator expressions –Decorators –Other news Beyond Python 2.4 Miscellaneous remarks Cute demos Question time

July 29, 2004© 2004 Guido van Rossum 4

July 29, 2004© 2004 Guido van Rossum 5 PSF Grants Grants for projects related to: –the further development of Python –Python-related technology –educational resources Proposals to be submitted by October 1, 2004 –proposals granted by November 1, 2004 –work to be completed by October 30, 2005 Up to $40,000 available in total See python.org for details and how to submit

July 29, 2004© 2004 Guido van Rossum 6

July 29, 2004© 2004 Guido van Rossum 7 Release Status Python 2.2 is resting ("pining for the fjords") Python 2.3 is actively maintained –2.3.4 came out in May –2.3.5 planned later this year –Anthony Baxter is release manager I am out of the loop! Python 2.4 alpha 2 to be released next week –2.4 final release expected Q –Anthony Baxter is release manager I am mostly out of the loop!

July 29, 2004© 2004 Guido van Rossum 8

July 29, 2004© 2004 Guido van Rossum 9 Generator Expressions Consider: print sum(x**2 for x in range(10)) Compare: –total = 0 for x in range(10): total += x**2 print total Factor out summing algorithm for reuse Concentrate on providing input without distractions Easily switch between different data processors –"accumulator functions" –"iterator algebra" a.k.a. pipelining

July 29, 2004© 2004 Guido van Rossum 10 Why Generator Expressions? Notation is immediately understandable Avoids building up a list of intermediate results –This is especially important if: intermediate results are large; or there are many intermediate results; or the source is an infinite sequence –e.g. from itertools: count(), cycle(), repeat() the consumer doesn't consume all results an interactive user is waiting for the initial results List comprehensions are a special case: –[f(x) for x...] is syntactic sugar for list(f(x) for x...) (in Python 2.4 there are some corner cases with different semantics; these will be fixed in 3.0) won't go away

July 29, 2004© 2004 Guido van Rossum 11 The Generator Expression Debate Someone noticed an "implementation flaw": –a = [] for f in [math.sin, math.cos, math.tan]: a.append(f(x) for x in range(10)) –for iterator in a: for x in iterator: print x, print –Prints math.tan(x) series three times! (f is bound late) Should we try to fix this? (If so, how?) NO! Genexps are for immediate consumption –fix the docs / tutorials / examples –delayed use would be expert/advanced use anyway working solutions are quite bearable

July 29, 2004© 2004 Guido van Rossum 12

July 29, 2004© 2004 Guido van Rossum 13 Decorators Consider (introduced in python 2.2): –class C: def func(args): lines of body text... func = staticmethod(func) Problem with this syntax: –programmer may forget to add the staticmethod() call –reader may miss the staticmethod() call Proposed solution: –class C: ***DECORATOR SYNTAX*** func(args): body

July 29, 2004© 2004 Guido van Rossum 14 What Is a Decorator? A decorator is a meta-function: –input is a callable or descriptor (implements __get__) –output is a callable or descriptor –examples: classmethod, staticmethod, (property) Other use cases: –metadata (e.g. author, version, deprecation) –processing rules (e.g. SPARK's grammar rules) –support for external language bindings (ObjC, C#) –framework annotations (e.g. PIKE) Ideally, decorators should be chainable

July 29, 2004© 2004 Guido van Rossum 15 Decorator Syntax Candidates Java 1.5: C#: –[decorator, decorator,...] Other proposals from Python developers: –[decorator, decorator,...] in various other positions –*[decorators]* – –[as decorators] –other keywords or symbols

July 29, 2004© 2004 Guido van Rossum 16 Decorator (Ab)uses def funcattrs(**kwds): def helper(func): func.__dict__.update(kwds) return func return helper Example with Java 1.5-derived syntax: author="GvR") def blah(args): body Example with C#-derived syntax: –[funcattrs(grammar="blah", author="GvR")] def blah(args): body

July 29, 2004© 2004 Guido van Rossum 17 Which Decorator Syntax? All styles have their disadvantages: looks unpythonic (?) –[deco, deco,...] prefix ambiguous syntax and doesn't work in interactive interpreter –[deco, deco,...] after arguments hides the decorators too much is awkward for long decorators –Other proposals look arbitrary (even 'as') In 2.4a2, we'll –if everybody hates it, we'll revisit in a3 or b1

July 29, 2004© 2004 Guido van Rossum 18

July 29, 2004© 2004 Guido van Rossum 19 What Else is New in 2.4? Faster (e.g. tklife.py gains ~20% speed-up) New built-in set types: set and frozenset Unifying int and long: now always the same results –except repr() still returns an 'L' suffix for longs New builtins: sorted(), reversed() Keyword arguments to list.sort(): cmp, key, reverse eval() takes arbitrary mapping for locals (only) None is a constant (assigning to it is a syntax error) Decimal floating point data type (module decimal) parser rewritten from scratch CJKCodecs integrated (East-Asian codecs) New module cookielib (client-side cookie handling) Windows distribution now built using MSVC++ 7.1

July 29, 2004© 2004 Guido van Rossum 20

July 29, 2004© 2004 Guido van Rossum 21 Beyond Python 2.4 Python : –gradual improvements –new library modules/packages –backwards-compatible changes –implement more existing PEPs –performance work –implementation internals work (e.g. AST branch) –experiment with features proposed for Python 3.0 There will not be a Python 2.10 –but may be released in parallel with 3.0

July 29, 2004© 2004 Guido van Rossum 22

July 29, 2004© 2004 Guido van Rossum 23 Python 3.0 (a.k.a. Python 3000) I had a Python 3.0 slide, but it's all day-dreaming 3.0 is my excuse for putting off thorny issues Has been "about 3 years away" since 2000 :-) I need to retire to be able to work on this Python 3.0 : 2.x isn't anything like Perl 6.0 : 5.x But it will be incompatible

July 29, 2004© 2004 Guido van Rossum 24

July 29, 2004© 2004 Guido van Rossum 25 Miscellaneous Remarks The sincerest form of flattery is imitation –Python borrows from many other languages –Now Ruby, Groovy, Prothon borrow from Python Python runs on Nokia Series 60 phones –Public release not yet certain –Would open up Nokia platform to more developers Write your secure programs in Python –1 security defect per 1000 lines across languages –But in Python it takes fewer lines :-) Community issues –Why is there still no Python equivalent of CPAN? –There are too many projects doing X; how to choose?

July 29, 2004© 2004 Guido van Rossum 26

July 29, 2004© 2004 Guido van Rossum 27 Cute Demos ElementClass –Simple way to describe (some) XML documents –Get attributes and subelements as Python attributes –Parses string or stream into tree in memory –Renders to string or stream –Not (yet) released, developed for Elemental Security Conway's Game of Life / Damian's cellular automata

July 29, 2004© 2004 Guido van Rossum 28

Question Time