1708
Comment: Add except E1, E2, E3 [as err]:
|
2192
some suggestions
|
Deletions are marked like this. | Additions are marked like this. |
Line 55: | Line 55: |
== Dumb ideas == == Other suggestions == GvR didn't pronounced on this *lists: * remove the extend method: s+=x is equivalent to s.extend(x) * change parameters order of the insert method and make the index parameter optional so that the s.append method can be removed. * remove the <> operator * remove the is operator ? * put the compile() function in its own module: on small interpreters, compiler support can be removed without changes to the core API. |
This page lists features that GvR has mentioned as goals for Python 3.0.
(Another list is at PythonThreeDotOh, but it incorporates items that GvR has never talked about.)
- Reduce feature duplication:
- string module vs. string methods
- xrange() vs range()
- int vs. long
- 8 bit vs. Unicode strings
- map/filter/reduce vs. list comprehensions
- lambda vs. def
- Library reorganization
- Return iterators instead of lists
- d.keys(), .values(), .items()
- range(), zip(), map(), filter()
- Consume iterators
- min(), max()
- Optional static typing?
- Support only new-style classes; classic classes will be gone.
Remove string exceptions, `x` for repr(x), sys.exc_type, coerce(), other deprecated stuff
- print as a function -- write(x,y,z), writeln(x,y,z)
- Do something so you can catch multiple exceptions using 'except E1, E2, E3:'. Maybe use 'except E1, E2, E3 as err:' if you want the error variable? (added by GvR, suggested by Bram Cohen).
See the "Python Regrets" talk and other recent presentations by Guido.
Other Ideas from the BDFL
I want to reserve the leading dot for attribute assignment to a special object specified by a 'with' statement, e.g.
with self: .foo = [1, 2, 3] .bar(4, .foo)
Rearrangements
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
exec as a statement is not worth it -- make it a function
Dumb ideas
Other suggestions
GvR didn't pronounced on this
- lists:
- remove the extend method: s+=x is equivalent to s.extend(x)
- change parameters order of the insert method and make the index parameter optional so that the s.append method can be removed.
remove the <> operator
- remove the is operator ?
- put the compile() function in its own module: on small interpreters, compiler support can be removed without changes to the core API.