The State of the Python Union BDFL PyCon – March 24, 2005 Guido van Rossum Elemental Security, Inc.

Slides:



Advertisements
Similar presentations
Kapil Mohan Sharma DMG - QA
Advertisements

Web 2.0 Programming 1 © Tongji University, Computer Science and Technology. Web Web Programming Technology 2012.
Jim McKeeth | Podcast at Delphi.org
1 VBScript Session What we learn last session? Regulars Expressions. Methods and properties. How to use the object and his collections. How to create.
IS 6116 Introduction – 10 Jan Lecturer Details Aonghus Sugrue Website: aonghussugrue.wordpress.com
Introduction to Algorithms 6.046J/18.401J
Introduction to Algorithms 6.046J/18.401J
"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.
Python: Building an Open Source Project and Community SDForum Distinguished Speaker Series, 2/17/05 Guido van Rossum Elemental Security,
Python 3000 (PyCon, 24-Feb-02007) Guido van Rossum
The State of the Python Union OSCON – August 3, 2005 Guido van Rossum Elemental Security, Inc.
State of the Python Union OSCON Portland, Oregon July 29, 2004 Guido van Rossum Elemental Security, Inc.
10/09/1999© 1999 CNRI, Guido van Rossum 1 Computer Programming for Everybody Guido van Rossum CNRI (Corporation for National Research Initiatives, Reston,
1 Discovering SharePoint What is SharePoint? What is SharePoint? How does it do that? How does it do that? How do we use it? How do we use it? What shape.
Single Sign-On with GRID Certificates Ernest Artiaga (CERN – IT) GridPP 7 th Collaboration Meeting July 2003 July 2003.
DBE Uniform Reporting: Understanding and Avoiding Common Errors Office of Civil Rights January 2014.
S-Curves & the Zero Bug Bounce:
1 What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight.
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving An Introduction Stewart Blakeway
Control Structures Selections Repetitions/iterations
Roles of Variables with Examples in Scratch
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.
Introduction Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
04/24/2014April 2014 Chapter Meeting1 Forcing IE 10 & 11 to play nicely with Retail Link™ Dan Batson Sr. Analyst / Category Advisor Fujifilm North America.
Bruce Beckles University of Cambridge Computing Service
M2 – Explain the tools and techniques used in the creation of an interactive website. By Arturas Vitkovskij.
ArrayLists David Kauchak cs201 Spring Extendable array Arrays store data in sequential locations in memory Elements are accessed via their index.
5-May-15 ArrayLists. 2 ArrayList s and arrays A ArrayList is like an array of Object s Differences between arrays and ArrayList s: Arrays have special.
Web Applications Development Using Coldbox Platform Eddie Johnston.
Ruby The Gem of new programming languages. An interpreted scripting language.
25-Jun-15 JavaScript Language Fundamentals II. 2 Exception handling, I Exception handling in JavaScript is almost the same as in Java throw expression.
Python Jordan Miller and Lauren Winkleman CS 311 Fall 2011.
Jonathan Huelman CSC 415 – Programming Languages
By Logan Phipps Hal student.  This power point explains some common programming languages enjoy  When done click on the home button to return to home.
Software Development Unit 6.
Python Introduction.
Programming 101 with Python: an open-source, cross-platform, and fun language By J. Burton Browning, Ed.D. Copyright © J. Burton Browning All rights reserved.
23-August-1999© 1999 CNRI, Guido van Rossum August-1999© 1999 CNRI, Guido van Rossum 2 Python Track Opening Words Guido van Rossum
Groovy WHAT IS IT? HOW DOES IT WORK? IS IT USEFUL?
About Python. Sept. 2003© Guido van Rossum 2 Executive Summary Dynamically typed object-oriented language Python programs look like executable.
Python 0 Some material adapted from Upenn cmpe391 slides and other sources.
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
The First Pune Python meet organized by PythonThreads.com The First Pune Python meet organized by PythonThreads.com What is it? Python is a Free, Open.
Planning a Group Policy Management and Implementation Strategy Lesson 10.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Executed by: Prokhorov N. Baybikov I. BI-01. Contents 1. Description 1. About Python 2.Origin 2. Properties 3. Pros & Cons 4. Usage 5. Conclusion.
240-Current Research Easily Extensible Systems, Octave, Input Formats, SOA.
Compsci 6/101, Spring More on Python, Tools, Compsci 101 l APTs, Assignments, Tools  APT: Algorithmic Problem-solving and Testing  How to get.
C463 / B551 Artificial Intelligence Dana Vrajitoru Python.
Python Overview  Last week Python 3000 was released  Python 3000 == Python 3.0 == Py3k  Designed to break backwards compatibility with the 2.x.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 4 – Shell Variables, More Shell Scripts.
Amortized Analysis and Heaps Intro David Kauchak cs302 Spring 2013.
By: Chad Gallati, Melissa Plakyda, Jenny Wilkes References: /a-z_programming_languages_groovy/
First appeared Features Popular uses Basic This language emphasises on ease of use, allowing general purpose programming to those with a small amount of.
A Python Tour: Just a Brief Introduction
CSE 374 Programming Concepts & Tools
NOCTI Study Guide #2.
About Python.
HOW MUCH PRICE OF DEVELOPING A CROSS-PLATFORM MOBILE APP?
Planning a Group Policy Management and Implementation Strategy
Introduction to Python
Introduction to Python
How to analyze the Cost of Cross- platform Mobile App Development?
JavaScript.
Agile testing for web API with Postman
Amortized Analysis and Heaps Intro
Presentation transcript:

The State of the Python Union BDFL PyCon – March 24, 2005 Guido van Rossum Elemental Security, Inc.

March 24, 2005© 2005 Guido van Rossum 2 Elemental Security, Inc. Enterprise security software cross-platform policy compliance reporting and enforcement Startup in stealth mode public launch April 5th! Using lots of Python We're always hiring! See

March 24, 2005© 2005 Guido van Rossum 3 Why my Keynotes Suck

March 24, 2005© 2005 Guido van Rossum 4 What's With the Beard? Started with a "beta [crunch] beard"; but then: "The authors of others script languages have no moustaches. Ruby and the Python is better, than Perl, but meet where less often than Perl. There is, however, a hope for Van Rossum, suddenly will grow a beard. It is not necessary to count on Mr. Matsumoto - at Japanese the beard grows badly. " – cached at: At Elemental I'm now called "professor"

March 24, 2005© 2005 Guido van Rossum 5 Decorators Redux Remember last year's keynote? –5 variations splicing [decorator,...] into a def [deco] def name():... // def [deco] name(): //... def name [deco] ():... // def name() [deco]: //... def name(): [deco]... So what happened? How win? –It's the one that everybody dislikes equally :-) –It's unambiguous and uses prefix syntax –Java 1.5 has similar syntax Why is it so controversial? –If you can handle __init__, why so bad? –Get over the Perl similarity already!

March 24, 2005© 2005 Guido van Rossum 6 Why No Class Decorators? Superfluous given metaclasses The need to be at near the top is easily met without adding new syntax May be revisited if someone cares enough –needs motivating use cases / examples

March 24, 2005© 2005 Guido van Rossum 7 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

March 24, 2005© 2005 Guido van Rossum 8 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)

March 24, 2005© 2005 Guido van Rossum 9 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 :-)

March 24, 2005© 2005 Guido van Rossum 10 Python Security Response Team Python's first official Vulnerability Alert –Accidental backdoor in SimpleXMLRPCServer –Fixed in Python 2.3.5, Realized the need for a standard way to handle vulnerabilities Formed Python Security Response Team So far, received only a small amount of spam ;-) Burton Group: Python has fewer vulnerabilities than Perl or PHP

March 24, 2005© 2005 Guido van Rossum 11 Release Talk It's official: no new features in double-dot releases 2.4.1: rc2 just out; final right after PyCon –sez Anthony Baxter 2.5: next year? 3.0: Who knows? Reminder: slow growth policy

March 24, 2005© 2005 Guido van Rossum 12 Python 3000 To be clear: this is the same as Python 3.0 Some progress: collecting ideas in PEP 3000 Py3k is not going to be "second system syndrome done right" (Larry Wall) 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 Many VMs competing: Jython, IronPython, Parrot,...

March 24, 2005© 2005 Guido van Rossum 13 Improving sum()? sum([1, 2, 3]) returns 6 class C(): def __add__(s, o):... sum([C(), C()]) raise an error But sum([C(), C()], C()) works Why can't sum([C(), C()]) return C()+C()? Lots of attempts to "fix" this; all end up flawed Conclusion: current behavior is right Signature: sum(seq: sequence[T], zero: T = 0) ->T IOW, sum() is already perfect!

March 24, 2005© 2005 Guido van Rossum 14 Adding any() and all() def any(seq): for x in seq: if x: return True return False def all(seq): for x in seq: if not x: return False return True Why not return x? –The return type would be surprising either if we fall through the loop or if the sequence is empty Why not anytrue() or anyfalse()? –if any(x < 0 for x in seq): raise ValueError("input<0")

March 24, 2005© 2005 Guido van Rossum 15 Killing map(), filter(), reduce() def map(f, seq): return [f(x) for x in seq] def filter(p, seq): return [x for x in seq if p(x)] def reduce(f, seq, zero): r = zero for x in seq: r = f(r, x) return r map() is occasionally clearer, e.g. map(str, seq) filter() is rarely clearer reduce() is usually more obscure –often need to take out pencil & paper to figure it out

March 24, 2005© 2005 Guido van Rossum 16 Killing lambda I can smell the next big flame war already :-) Example of bad lambda: map(lambda x: x+42, seq) –Should be [x+42 for x in seq] But: w.setCallback(lambda: self.setText("Booh")) v. def callback(): self.setText("Booh") w.setCallback(callback) Can we add anonymous code blocks? w.setCallback({self.setText("Booh")}) –(That was a joke) It's far from clear what to do here –I haven't had time to follow the discussion on py-dev

March 24, 2005© 2005 Guido van Rossum 17 Numeric Needs Requirement: 0-dim array treated as scalar Possible solution: where an int is required (e.g. for indexing a sequence), and something else is given, call its __index__ method to convert it to an int –Avoids the trap that using __int__ would allow floats to be used as indices Requirement: control over zero division behavior Possible solution: make zero division a warning, then use the warning module to control its behavior –Return Inf or NaN when no exception raised –May need to control int and float separately

March 24, 2005© 2005 Guido van Rossum 18 Wake Up! Or pretend you're asleep The following may just be a bad dream :-)

March 24, 2005© 2005 Guido van Rossum 19 Optional Static Typing NOTE: Nothing's settled yet!!!!!!!!!!!!!!!! Strawman syntax: –def foo(a: int, b: list[int]) -> list[str]:... Strawman semantics: –def foo(a, b): a = __typecheck__(a, int) b = __typecheck__(b, list[int]) r = __original_foo(a, b) return __typecheck__(r, list[str]) –def __typecheck__(x, T): # new builtin if adapt(x, T) is not x: # see PEP 246 raise TypeError(...) return x –__typecheck__ is overridable per module

March 24, 2005© 2005 Guido van Rossum 20 Contentious Points The syntax –About 500 people asked whether someone has already proposed using 'x as int' instead of 'x: int' –About 50 people suggested 'int x' –One person proposed 'int(x)' –The ':' is redundant; we could just write def foo(a int, b list[int]) list[str]:... Nobody has pointed this out yet :-) What does list[int] mean, anyway? –Hold that thought... And that's not all...

March 24, 2005© 2005 Guido van Rossum 21 Interfaces I am assuming that this will be introduced together with a syntax for interfaces (for example PEP 245) –but the new syntax would not be limited to interfaces Where in the example I wrote list[int], in practice you might be writing sequence[integer] or even iterable[integer] (but not iterator[integer]) Or perhaps list[int] could actually mean the same thing? The one thing we want to avoid at all cost: –people writing list[int] because they think in terms of concrete types, while the right type to use is sequence[integer] or iterable[integer]

March 24, 2005© 2005 Guido van Rossum 22 __typecheck__ is a Compromise Note the trick: __typecheck__ passes iff adapt(x, T) returns x itself rather than a wrapper –this allows people to customize type checking by providing identity adapters –for example, adapt([], sequence) should return [] You can override this to use stricter or less strict type checking per module by defining a module- global function named __typecheck__ For example (what the PEP 246 crowd wanted): def __typecheck__(x, T): return adapt(x, T) Perhaps it shouldn't be called __typecheck__?

March 24, 2005© 2005 Guido van Rossum 23 Generic types So what does list[int] mean? It's a list of ints, duh! How does this work, in general? It could be Python's syntax for generic types dict[str, int] is a dict with str keys and int values list and dict still work too (same as list[object] etc.) You can define your own parameterized types Contentious strawman syntax: –interface List[T](object): def append(x: T): "yadda yadda" def extend(a: sequence[T]): "..." def __getslice__(i: int, j: int) -> List[T]: "..."

March 24, 2005© 2005 Guido van Rossum 24 How to Typecheck Generic Types Ai, there's the rub! def foo(x: list[int]) -> int: bar(x) return x[-1] def bar(x: list): # untyped x.append(snarf()) It would be bad enough to have to verify that every item of x is an int upon entry into foo() It would be even worse to have to do that again after the call to bar(), which might violate the constraint One option: don't check, it's documentation only

March 24, 2005© 2005 Guido van Rossum 25 A Psychological Concern What if, despite our best efforts, it becomes a style requirement to use type declarations everywhere? Then we'd have lost! It could happen, given the strong meme that, while dynamic typing is convenient in the short run, static typing is somehow "better" Possible counter-measures: –dynamic signature checking slows down your code –add tools to do type inferencing without declarations –only support type declarations in interfaces –forget the whole thing

March 24, 2005© 2005 Guido van Rossum 26 Reminder and Disclaimer If the previous 8 slides felt like a bad dream... Or if they sounded too good to be true... Nothing's settled yet!!!!!!!!!!!!!!!!!!!!!!!!! This is just the beginning (again :-) of a long trip...

March 24, 2005© 2005 Guido van Rossum 27 Question Time PS. Stay for the PSF promotional meeting at 10:15