The State of the Python Union OSCON – August 3, 2005 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
1 VBScript Session What we learn last session?
Implementing Domain Decompositions Intel Software College Introduction to Parallel Programming – Part 3.
BetterInvestings Portfolio Manager Portfolio Manager with other BetterInvesting Resources Created by: QUANT IX SOFTWARE, Inc. Revised: November, 2005.
BetterInvestings Portfolio Manager Improving Mutual Fund Decisions Created by: QUANT IX SOFTWARE, Inc. Revised: November, 2005.
BetterInvestings Portfolio Manager Understanding the Home Page Created by: QUANT IX SOFTWARE, Inc. Revised: July, 2007 We suggest you print the matching.
Final and Abstract Classes
Chapter 7 System Models.
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Chapter 7 Constructors and Other Tools. Copyright © 2006 Pearson Addison-Wesley. All rights reserved. 7-2 Learning Objectives Constructors Definitions.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Copyright © 2003 Pearson Education, Inc. Slide 1.
AJDT and AspectJ Release Review | © 2007 by SpringSource, made available under the EPL v1.0 1 Release Review: AJDT and AspectJ
"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.
State of the Python Union OSCON, July 24, 2002 Guido van Rossum Director of PythonLabs at Zope Corporation
Python 3000 (PyCon, 24-Feb-02007) Guido van Rossum
The State of the Python Union BDFL PyCon – March 24, 2005 Guido van Rossum Elemental Security, Inc.
State of the Python Union OSCON Portland, Oregon July 29, 2004 Guido van Rossum Elemental Security, Inc.
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
18 Copyright © 2005, Oracle. All rights reserved. Distributing Modular Applications: Introduction to Web Services.
3 Copyright © 2005, Oracle. All rights reserved. Basic Java Syntax and Coding Conventions.
7 Copyright © 2005, Oracle. All rights reserved. Creating Classes and Objects.
6 Copyright © 2005, Oracle. All rights reserved. Building Applications with Oracle JDeveloper 10g.
Haas MFE SAS Workshop Lecture 3:
More about Ruby Maciej Mensfeld Presented by: Maciej Mensfeld More about Ruby dev.mensfeld.pl github.com/mensfeld.
Chapter 2.2 – More about Ruby Maciej Mensfeld Presented by: Maciej Mensfeld More about Ruby dev.mensfeld.pl github.com/mensfeld senior.
Exception Handling Genome 559. Review - classes 1) Class constructors - class myClass: def __init__(self, arg1, arg2): self.var1 = arg1 self.var2 = arg2.
40 Tips Leveraging the New APICS.org to the Benefit of Your Organization, Members, and Customers! 1.
Week 2 The Object-Oriented Approach to Requirements
Configuration management
Modern Programming Languages, 2nd ed.
Semantic Analysis and Symbol Tables
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 12 – Security Panel Application Introducing.
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Error-handling using exceptions
CMPT 120 Functions and Decomposition
© 2012 National Heart Foundation of Australia. Slide 2.
Lilian Blot VARIABLE SCOPE EXCEPTIONS FINAL WORD Final Lecture Spring 2014 TPOP 1.
Executional Architecture
Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.
Chapter 10: The Traditional Approach to Design
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
Benchmark Series Microsoft Excel 2013 Level 2
CMPT 100 : INTRODUCTION TO COMPUTING TUTORIAL #5 : JAVASCRIPT 2 GUESSING GAME By Wendy Sharpe 1.
Languages for IT & CS Pseudo-code What HTML isn’t Early history Compiling & interpreting Classifying languages The process of programming.
South Dakota Library Network MetaLib User Interface South Dakota Library Network 1200 University, Unit 9672 Spearfish, SD © South Dakota.
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.
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
1 Programming Languages (CS 550) Mini Language Interpreter Jeremy R. Johnson.
CS1022 Computer Programming & Principles
Bruce Beckles University of Cambridge Computing Service
A Crash Course Python. Python? Isn’t that a snake? Yes, but it is also a...
Lecture 07 – Exceptions.  Understand the flow of control that occurs with exceptions  try, except, finally  Use exceptions to handle unexpected runtime.
An Introduction to Python and Its Use in Bioinformatics
Exceptions COMPSCI 105 SS 2015 Principles of Computer Science.
Cem Sahin CS  There are two distinguishable kinds of errors: Python's Errors Syntax ErrorsExceptions.
Python Overview  Last week Python 3000 was released  Python 3000 == Python 3.0 == Py3k  Designed to break backwards compatibility with the 2.x.
Python Built-in Exceptions Data Fusion Albert Esterline Source:
Lecture 07 – Exceptions.  Understand the flow of control that occurs with exceptions  try, except, finally  Use exceptions to handle unexpected runtime.
COMPSCI 107 Computer Science Fundamentals
George Mason University
Presentation transcript:

The State of the Python Union OSCON – August 3, 2005 Guido van Rossum Elemental Security, Inc.

Health Update

August © 2005 Guido van Rossum 3

August © 2005 Guido van Rossum 4

Prologue

August © 2005 Guido van Rossum 6 Elemental Security, Inc. Enterprise security software express, monitor and enforce security policies for any computer connecting to the network (cross-platform) scored 9.3 in recent InfoWorld Test Center Startup (no longer in stealth mode!) C round just closed; 11M led by Lehman Brothers Using lots of Python (and Java!) We're always hiring! See Now a real website :-)

August © 2005 Guido van Rossum 7 Elemental Security and Python Paid for Python port to HP-UX on Itanium2 –Giving back to PSF, of course! –AIX 5.3 to follow shortly Also plan to contribute: –ElementClass (yet another XML tool :-) –pgen reimplemented in Python –yeah, I know, I promised these last year too... Talk Wednesday (09:30 in VB) –"What I did last year"

August © 2005 Guido van Rossum 8 The Python Software Foundation Holds and protects the IP (©, ®) behind Python Makes PyCon possible by taking the financial risk Funds grants, e.g. Jython grant and python.org redevelopment Participates in Google's Summer of Code There are 750K+ Python programmers –if 1% gave $100/yr (or 10% gave $10/yr) we would have $750K/year budget

Appetizers

August © 2005 Guido van Rossum 10 Python's Growing Popularity 14% (from 8%) – InfoWorld survey (Sept '04) –"But the big winner this time around is the object- oriented scripting language Python, which saw a 6 percent gain in popularity, almost doubling last year's results. " Burton Group report on "P-languages": –"Both Perl and Python have been used in application development and for limited integration, but it appears that Python is a better fit for this domain for several reasons. Python is easy to learn, fully functional, syntactically clean, and very modular. " Report available for $$ via Tim O'Reilly: Python book sales are gaining on Perl!

August © 2005 Guido van Rossum 11 Jolt Productivity Award for Python Category: Languages and Development Tools Runner-up, shared with IntelliJ & RealBasic Category winner: Eclipse SD Magazine & Conference Second time around (last time won was in 2000)

August © 2005 Guido van Rossum 12 Python.org Growth Feb 2004 python.org traffic: –793K visits from 421K sites (1.0 TB) Feb 2005 python.org traffic: –1023K visits from 473K sites (1.3 TB) Growth in one year: –visits +29%, originating sites +12%, data +30% –and Feb 2004 had a leap day :-)

August © 2005 Guido van Rossum 13 O'Reilly CodeZoo Now with Python section!

August © 2005 Guido van Rossum 14 Languages Used on SourceForge data = "..." # scraped from SF website import re lines = [line.strip() for line in data.splitlines()] lines = [line for line in lines if line] table = [] for line in lines: m = re.match("(.*)\s\((\d+) projects\)", line) if m: table.append((int(m.group(2)), m.group(1))) table.sort() table.reverse() for count, language in table: print "%6d %s" % (count, language)

August © 2005 Guido van Rossum 15 Top 20 Languages on SourceForge C Java C PHP 5974 Perl 4200 Python 2597 C# 2488 JavaScript 2127 Visual Basic 1841 Delphi/Kylix 1746 Unix Shell 1571 Assembly 1114 PL/SQL 886 Tcl 697 Objective C 545 ASP 360 Ruby 338 Pascal 317 Lisp 267 Object Pascal

Main Course

August © 2005 Guido van Rossum 17 PEP 342 and PEP 343 Discussion on python-dev broke all records Results are really nice PEP 342 adds generator enhancements –patch by Phillip Eby just checked in (needs work) PEP 343 adds with-statement –no patch yet Both PEPs accepted at EuroPython last month

August © 2005 Guido van Rossum 18 QOFT "I still haven't gotten used to Guido's heart-attack inducing early enthusiasm for strange things followed later by a simple proclamation I like. Some day I'll learn that the sound of fingernails on the chalkboard is frequently followed by candy for the whole class." –Jack Diederich

August © 2005 Guido van Rossum 19 PEP 342: Generator Enhancements yield-expression instead of yield-statement –x = yield a, b, c –print (yield abc) –"yield" is equivalent to "yield None" g.send(value) causes yield to return value –g.send(None) is equivalent to g.next() –initial call must be next() or g.send(None) g.throw(exc, [val, [tb]]) causes yield to raise exc g.close(): throws GeneratorExit; called by GC yield is now allowed inside try/finally

August © 2005 Guido van Rossum 20 What Does This Buy Us? More coroutine-like functionality Natural asynchronous event handling Generators can emulate lightweight threads Twisted example (from memory): d = Deferred(...) w = WaitForDeferred(d) yield w data = w.getResult()...use data... –becomes: d = Deferred(...) data = yield d...use data...

August © 2005 Guido van Rossum 21 PEP 343: The With-Statement with EXPR [as VAR]: BLOCK Translation: abc = EXPR [VAR =] abc.__enter__() try: BLOCK finally: abc.__exit__(...) The... mean that __exit__() is called as follows: –if BLOCK raised exception, __exit__(*sys.exc_info()) –otherwise, __exit__(None, None, None) I'm no longer favoring Pascal-style with-statement

August © 2005 Guido van Rossum 22 What Does This Buy Us? No excuse any more to write this: mutex.acquire()...critical section code... mutex.release() (See the bug?) Because this is less typing: with mutex:...critical section code... Observation: –using try/finally blocks is often a requirement of an API rather than a choice for that API's user –at least when you use try/except anywhere else

August © 2005 Guido van Rossum 23 Rejected PEPs Raymond Hettinger pushed me to pronounce on these: PEP 336 – Make None Callable PEP 313 – Roman Numerals PEP 303 – Extended divmod() PEP 284 – Integer for-loops PEP 281 – Loop counter iteration with [x]range() PEP 276 – Simple iterator for ints PEP 274 – Dict Comprehensions (withdrawn by author) PEP 265 – Sorting Dictionaries by Value PEP 239, 240 – Rational Type and Rational Literal Several others superseded by PEPs 342/343 –288, 310, 319, 325, 340, 346

August © 2005 Guido van Rossum 24 Hopeful PEPs PEP 3000 – Python 3.0 Plans PEP 344 – Exception Chaining & Embedded Tracebacks PEP 341 – Unifying try/except/finally (accepted) PEP 315 – do-while statement PEP 246 – Adaptation (won't die, won't commit :-) not quite PEP 245 – Interface declarations PEP-to-be-named – Exception Reform Probably others, but I've been too busy to check

August © 2005 Guido van Rossum 25 Exception Reform Proposal PEP by Brett Cannon forthcoming Bare 'except:' catches StandardError Exceptions must derive from 'Exception' Some restructuring of the hierarchy Some new exceptions Some new inheritance Rename some exceptions Deprecate WindowsError Use multiple inheritance for compatibility period Discussion is still ongoing!!!

August © 2005 Guido van Rossum 26 Possible New Exception Hierarchy Exception + ControlFlowException (new) + StopIteration + GeneratorExit + SystemExit + CriticalError (new) + KeyboardInterrupt + MemoryError + SystemError + StandardError + AssertionError + SyntaxError + IndentationError + TabError + UserError (rename of RuntimeError) + ArithmeticError + FloatingPointError + DivideByZeroError + OverflowError + UnicodeError + UnicodeDecodeError + UnicodeEncodeError + UnicodeTranslateError + LookupError + IndexError + KeyError + TypeError + AttributeError + EnvironmentError + OSError + IOError + EOFError (new inheritance) + socket.error (new inheritance) + select.error (new inheritance) + ImportError + NotImplementedError (new inheritance) + NamespaceError (rename of NameError) + UnboundGlobalError (new) + UnboundLocalError + UnboundFreeError (new) + ValueError + Warning + UserWarning + AnyDeprecationWarning (new) + PendingDeprecationWarning + DeprecationWarning + SyntaxWarning + SemanticsWarning (rename of RuntimeWarning) + FutureWarning + WeakReferenceError (rename of ReferenceError) + WindowsError (deleted)

August © 2005 Guido van Rossum 27 Python 3000 (To be clear: this is the same as Python 3.0) Not "second system syndrome done right" In particular, not rewriting CPython from scratch More likely, various Py3k features will show up in Python 2.5, 2.6,...; some directly, some with a __future__ import Python 3.0 will be incompatible with Python 2.9 Focus on language + library, not implementation Library restructuring needs a champion! Many VMs competing: Jython, IronPython, Parrot,...

August © 2005 Guido van Rossum 28 Optional Type Declarations The controversial topic that keeps coming back! See my blogs of last December – January Mostly in support for documentation, IDEs No compile-time checking (but can help PyChecker) Perhaps no run-time semantics (docs only) Perhaps adaptation-based semantics –customizable by overriding __typecheck__ should probably rename this (to what?) –see blogs for details Perhaps most useful in interface declarations

August © 2005 Guido van Rossum 29 My Favorite Syntax def f(x: str, y: list[int], z: file|None = None)->bool:... Full syntax for an argument: –ARG ::= NAME [':' EXPR] ['=' EXPR] –Possibly also for (esp. instance) variables x[y] and x|y operators supported by type metaclass –x[y] probably only for container types (e.g. list, dict) –x[y, z,...] supported too –user-defined types (classes) can do this too Variables in type expressions resolved at run-time –(at function definition time, like default expressions)

August © 2005 Guido van Rossum 30 Rejected Syntax Alternatives ARG ::= NAME as TYPE –VB style –PEP 343 uses 'as' very differently (with EXPR as VAR) ARG ::= TYPE NAME –C/C++/Java/C# style –ambiguous as soon as TYPE is more than a name ARG ::= TYPE(NAME) –Pythonic cast style (my name for it) –doesn't read well when TYPE is list[int] or file|None

Dessert

August © 2005 Guido van Rossum 32 Python Release Schedule "the plan is still for a in mid-September" –Anthony Baxter (release manager)

Coffee, Cognac

August © 2005 Guido van Rossum 34

Question Time