We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byGrace Craig
Modified over 2 years ago
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
What's New in Python? "Not your usual list of new features" Stanford CSL Colloquium, October 29, 2003; BayPiggies, November 13, 2003 Guido van Rossum Elemental.
Python at Elemental Security EuroPython - June 29, 2005 Guido van Rossum Elemental Security, Inc.
Python 3000 (ACCU Conference / Oxford, UK / April 19, 2006) Guido van Rossum
Reston/San Diego, July 25, O'Reilly Open Source Convention 2001 San Diego, CA Python Track Keynote Guido van Rossum Zope Corporation
State of the Python Union PyCon DC, March 26-28, 2003 Guido van Rossum Director of PythonLabs at Zope Corporation
State of the Python Union OSCON, July 24, 2002 Guido van Rossum Director of PythonLabs at Zope Corporation
Tutorial on Python Programming Chetan Giridhar January 19, 2014.
EuroPython Keynote June 26, 2002 Guido van Rossum Director of PythonLabs at Zope Corporation
® ® Why Design Another Language? Python UK & ACCU Spring Conference Oxford - April 2, 2003 Guido van Rossum Director of PythonLabs at Zope Corporation.
The State of the Python Union BDFL PyCon – March 24, 2005 Guido van Rossum Elemental Security, Inc.
The State of the Python Union OSCON – August 3, 2005 Guido van Rossum Elemental Security, Inc.
1 Maintaining large software systems Dr L Bottaci Department of Computer Science University of Hull, Hull, UK.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 7 Defining Your Own Classes Part 2 Animated Version.
Telecooperation/RBG Technische Universität Darmstadt Copyrighted material; for TUD student use only Introduction to Computer Science I Topic 11: Introduction.
Chapter 6 Writing a Program Bjarne Stroustrup
Why I Invented Python EuroPython – June 27, 2005 Guido van Rossum Elemental Security, Inc.
Python 3000 (PyCon, 24-Feb-02007) Guido van Rossum
Copyright © 2009 Elsevier Chapter 3:: Names, Scopes, and Bindings Programming Language Pragmatics Michael L. Scott.
Peter Norvig, Harlequin, Inc. 1 Object World, May 5, 1996 Design Patterns in Dynamic Programming Peter Norvig Chief Designer, Adaptive Systems Harlequin.
JPython Update Jim Hugunin Corporation for National Research Initiatives.
Python 3000 and You Guido van Rossum PyCon March 14, 2008.
Python 3000 and You Guido van Rossum EuroPython July 7, 2008.
aQute Bundle Programming By Peter Kriens CEO aQute OSGi Director of Technology & OSGi Fellow.
Computing Higher - SD Process – Topic 2 St Andrew’s High School Unit 2 Software Development Process.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 1 Why Parallel Computing? An Introduction to Parallel Programming Peter Pacheco.
Programming For Nuclear Engineers Lecture 10 MATLAB 1.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Basics of Perl.
DC-API: Unified API for Desktop Grid Systems Gábor Gombás MTA SZTAKI.
1 Introduction to ASP.NET. 2 Static and Dynamic Web Applications HTML is used to create static content Browser software interprets HTML tags and formats.
10-1. Systems Analysis & Programming 10.1 Systems Development 10.2 Programming: A Five-Step Procedure Generations of Programming Languages 10.4.
© 2016 SlidePlayer.com Inc. All rights reserved.