the state of the python union · • warning: shameless plug ahead • "familiar" linux...

18
"The State of the Python Union" Python10 - Alexandria, VA - February 7, 2002 Guido van Rossum Director, PythonLabs at Zope Corporation [email protected] [email protected]

Upload: others

Post on 31-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

"The State of the Python Union"

Python10 - Alexandria, VA - February 7, 2002

Guido van Rossum

Director, PythonLabs at Zope Corporation

[email protected]

[email protected]

Page 2: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 2 ©2001, 2002 Guido van Rossum

Overview

• Toy of the year

• Where are we now

• Parade of the PEPs

• Open mike

Page 3: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 3 ©2001, 2002 Guido van Rossum

Toy of the Year

• Warning: shameless plug ahead

• "familiar" Linux on iPAQ

• Python as main development language

• Go to handhelds.org

Page 4: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 4 ©2001, 2002 Guido van Rossum

Where Are We Now

• Python 2.2 released (Dec 21)– iterators, generators

– type/class unification

– new bugs :(

• Working on Python 2.2.1 (within a month)– fix the bugs :)

• Planning Python 2.3 (this summer)– library improvements

– next phase of int/long unification

– WHAT ELSE?!?!

Page 5: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 5 ©2001, 2002 Guido van Rossum

Too Many Choices!

• New languages features

• Extend import

• Expand library

• Improve performance

• Restructure implementation

• Other wild ideas

• Too many choices! What to work on????

Page 6: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 6 ©2001, 2002 Guido van Rossum

New Language Features?

• Syntactic sugar for new class features?– static/class methods

– slots

– properties

– super

• Dict comprehensions? (PEP 274)

• Generator comprehensions?– [yield x**2 for x in range(10)]

• TBL's triple graph notation?– {sky color blue, gray; sea color green}

Page 7: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 7 ©2001, 2002 Guido van Rossum

Static Methods, Class Methods?

• class C: # extra keyword after defdef static foo(arg1, arg2): ...def class cfoo(cls, args): ...

• class C: # list of propertiesdef foo [static](arg1, arg2): ...def foo [class](arg1, arg2): ...

• class C: # keyword in front of defstatic def foo(arg1, arg2): ...class def cfoo(cls, arg1, arg2): ...

• class C: # implicit by lack of 'self'def foo(arg1, arg2): ...def cfoo(cls, arg1, arg2): ...

Page 8: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 8 ©2001, 2002 Guido van Rossum

Slots???

• class C:slot a, b, c

• class C:a, b, c: slot

• class C:slots:

a: intb: strc

• Is 'slot' the right word?

Page 9: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 9 ©2001, 2002 Guido van Rossum

Properties?

• class C:property a:

"""Computed variable a"""def get(self): ...def set(self, value): ...def delete(self): ...

• class C:properties:

a:def get(self): ...

b:def get(self): ...def set(self): ...

Page 10: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 10 ©2001, 2002 Guido van Rossum

Super?

• class C(A,B):def save(self, file):

...dadada...super.save(file)...tatata...

Page 11: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 11 ©2001, 2002 Guido van Rossum

New Keywords?

• super, property, slot to become keywords?

• Need to allow "old" (2.2) usage too!

• Context-sensitive keywords???

• E.g.– property is only a keyword at start of line

– static is only a keyword if followed by dot

Page 12: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 12 ©2001, 2002 Guido van Rossum

Extending Import?

• ihooks is for all practical purposes dead :)

• imputils might as well be dead :(

• import from zip file is very much alive!

• Webizing Python (TBL)?– add "http://python.org/Python2.2/" to sys.path?

– Mike McLay asked for this 5 years ago :)

Page 13: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 13 ©2001, 2002 Guido van Rossum

Expand Library?

• Logging module?

• PyChecker?

• Persistence, ZODB?

• YAPPS or SPARK?– Expose pgen?

• ...?

• DB-API 3?

• TBL's triple store API?

Page 14: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 14 ©2001, 2002 Guido van Rossum

Improve Performance?

• 2.2 slower than 2.1 slower than 2.0 slower than 1.5.2!– (But sometimes 2.2 is fastest!)

• Improve virtual machine?

• PyMalloc?

• "Low-hanging fruit" in bytecode– Faster globals

– Recognize built-ins?

– Faster attributes???

• Come to session with Jeremy and Skip

Page 15: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 15 ©2001, 2002 Guido van Rossum

Restructure Implementation?

• More can be done in Python– saves C code

• Much already exists as alternative!– print tracebacks

– bytecode compiler (from abstract syntax tree)

– interactive command line

– import

• What else?

• Careful: code may be compromised

Page 16: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 16 ©2001, 2002 Guido van Rossum

Parade of the PEPs

• Switch to IE window

Page 17: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 17 ©2001, 2002 Guido van Rossum

Open Mike

• Your turn

Page 18: The State of the Python Union · • Warning: shameless plug ahead • "familiar" Linux on iPAQ • Python as main development language • Go to handhelds.org. Slide 4 ©2001, 2002

Slide 18 ©2001, 2002 Guido van Rossum

And Don't Forget...

>>> import this

The Zen of Python, by Tim Peters

Beautiful is better than ugly.

Explicit is better than implicit.

Simple is better than complex.

Complex is better than complicated.

Flat is better than nested.

Sparse is better than dense.

Readability counts.

Special cases aren't special enough to break the rules.

Although practicality beats purity.

Errors should never pass silently.

Unless explicitly silenced.

In the face of ambiguity, refuse the temptation to guess.

There should be one-- and preferably only one --obvious way to do it.

Although that way may not be obvious at first unless you're Dutch.

Now is better than never.

Although never is often better than *right* now.

If the implementation is hard to explain, it's a bad idea.

If the implementation is easy to explain, it may be a good idea.

Namespaces are one honking great idea -- let's do more of those!

>>>