Python Regrets OSCON, July 25, 2002

Slides:



Advertisements
Similar presentations
Python 3000 and You Guido van Rossum EuroPython July 7, 2008.
Advertisements

"The State of the Python Union" Python10 - Alexandria, VA - February 7, 2002 Guido van Rossum Director, PythonLabs at Zope Corporation
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
What's New in Python 2.2 LinuxWorld - New York City - January 2002 Guido van Rossum Director of PythonLabs at Zope Corporation
Python 3000 and You Guido van Rossum PyCon March 14, 2008.
Python 3000 (ACCU Conference / Oxford, UK / April 19, 2006) Guido van Rossum
EuroPython Keynote June 26, 2002 Guido van Rossum Director of PythonLabs at Zope Corporation
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
Python Basics: Statements Expressions Loops Strings Functions.
Types and Arithmetic Operators
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
Python November 18, Unit 7. So Far We can get user input We can create variables We can convert values from one type to another using functions We can.
Introduction to Python
Chapter 2 Writing Simple Programs
Introduction to Python (for C++ programmers). Background Information History – created in December 1989 by Guido van Rossum Interpreted Dynamically-typed.
Subroutines Just like C, PERL offers the ability to use subroutines for all the same reasons – Code that you will use over and over again – Breaking large.
Python.
Introduction to Python Guido van Rossum Director of PythonLabs at Zope Corporation
Lists in Python.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Input, Output, and Processing
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #005 (April somthin, 2015)
Mathematical Calculations in Java Mrs. G. Chapman.
Functions Chapter 4 Python for Informatics: Exploring Information
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Introducing Python CS 4320, SPRING Resources We will be following the Python tutorialPython tutorial These notes will cover the following sections.
Variables, Expressions, and Statements
Chapter 14 Advanced Function Topics CSC1310 Fall 2009.
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Python Conditionals chapter 5
Python Basics. 2 Python History Late 1970s: programming language called ABC at the Centrum voor Wiskunde en Informatica in the Netherlands Audience included.
Mathematical Calculations in Java Mrs. C. Furman.
Jim Havrilla. Invoking Python Just type “python –m script.py [arg]” or “python –c command [arg]” To exit, quit() or Control-D is used To just use the.
Minimal standard C program int main(void) { return 0 ; }
ICS3U_FileIO.ppt File Input/Output (I/O)‏ ICS3U_FileIO.ppt File I/O Declare a file object File myFile = new File("billy.txt"); a file object whose name.
Data Types and Conversions, Input from the Keyboard CS303E: Elements of Computers and Programming.
Programming Fundamentals. The setw Manipulator setw changes the field width of output. The setw manipulator causes the number (or string) that follows.
Lecture 4 Python Basics Part 3.
PYTHON VARIABLES : CHAPTER 2 FROM THINK PYTHON HOW TO THINK LIKE A COMPUTER SCIENTIST.
Winter 2016CISC101 - Prof. McLeod1 CISC101 Reminders Quiz 3 next week. See next slide. Both versions of assignment 3 are posted. Due today.
Type Casting. Type casting Sometimes you need a piece of data converted to a different type In Python you do a typecast to cause that to happen int(3.599)
Quiz 3 Topics Functions – using and writing. Lists: –operators used with lists. –keywords used with lists. –BIF’s used with lists. –list methods. Loops.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
More about Iteration Victor Norman CS104. Reading Quiz.
Chapter 2 Writing Simple Programs
Topics Designing a Program Input, Processing, and Output
Python: Experiencing IDLE, writing simple programs
Data Types and Conversions, Input from the Keyboard
Presented By S.Yamuna AP/IT
Formatting Output.
CHAPTER FOUR Functions.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Winter 2018 CISC101 11/22/2018 CISC101 Reminders
Python Useful Functions and Methods
CISC101 Reminders Assn 3 due tomorrow, 7pm.
CSC1018F: Intermediate Python
Reading Input from the Keyboard
Topics Designing a Program Input, Processing, and Output
Python for Informatics: Exploring Information
CISC101 Reminders All assignments are now posted.
Topics Designing a Program Input, Processing, and Output
Topics Introduction to File Input and Output
Topics Designing a Program Input, Processing, and Output
CISC101 Reminders Assignment 3 due next Friday. Winter 2019
Winter 2019 CISC101 4/28/2019 CISC101 Reminders
CISC101 Reminders Assignment 3 due today.
Class code for pythonroom.com cchsp2cs
Presentation transcript:

Python Regrets OSCON, July 25, 2002 Guido van Rossum Director of PythonLabs at Zope Corporation guido@zope.com guido@python.org

Relics Stuff that’s already being phased out string exceptions sys.exc_type etc. (use sys.exc_info()) int/int returning int apply() (use f(*args, **kwds)) coerce() (no longer needed) 3-way compare? (but... comparing lists)

Lexical details continued lines or strings with \ use (...) continuation and/or string literal concatenation if expression: statement put statement on next line tabs? require all spaces or very restricted use of tabs (not mixed)

Lambda and functional stuff I've never liked lambda crippled (only one expression) confusing (no argument list parentheses) can use a local function instead map(), filter() using a Python function here is slow list comprehensions do the same thing better reduce() nobody uses it, few understand it a for loop is clearer & (usually) faster

print, str() and repr() drop `x` for repr(x) ` is hard to read in many fonts publication process turns 's' into ‘s’ do we really need both str() and repr()? mostly intended to be able to special-case "print x" when x is a string still not enough; need nice() that's a bybrid print should've been a function write(x, y, z) writeln(x, y, z) spaces between items controlled by keyword arg

Builtins intern(), id(): put in sys xrange(): make range() return an iterator buffer(): must die (use bytes, PEP 296) raw_input(): use sys.stdin.readline() input(): use eval(sys.stdin.readline()) callable(): just call it, already execfile(), reload(): use exec() compile(): put in sys

Special cases for exec exec as a statement is not worth it make it a function (again :-) perhaps shouldn't have locals(), globals(), vars()

Restricted execution Too many bugs to be trusted didn't get enough review, and never will Confusion btw. __builtins__, __builtin__ But there's a useful idea somewhere... Zope uses this

Float to int conversion need more ways to convert float to int (round, truncate-towards-zero, floor, ceil) need differentiate to __int__ which truncates and __int__ which doesn't