[RELEASED] Python 3.1 beta 1

  • Thread starter Benjamin Peterson
  • Start date
B

Benjamin Peterson

On behalf of the Python development team, I'm thrilled to announce the first and
only beta release of Python 3.1.

Python 3.1 focuses on the stabilization and optimization of features and changes
Python 3.0 introduced. For example, the new I/O system has been rewritten in C
for speed. File system APIs that use unicode strings now handle paths with
undecodable bytes in them. [1] Other features include an ordered dictionary
implementation and support for ttk Tile in Tkinter. For a more extensive list
of changes in 3.1, see http://doc.python.org/dev/py3k/whatsnew/3.1.html or
Misc/NEWS in the Python distribution.

Please note that this is a beta release, and as such is not suitable for
production environments. We continue to strive for a high degree of quality,
but there are still some known problems and the feature sets have not been
finalized. This beta is being released to solicit feedback and hopefully
discover bugs, as well as allowing you to determine how changes in 3.1 might
impact you. If you find things broken or incorrect, please submit a bug report
at

http://bugs.python.org

For more information and downloadable distributions, see the Python 3.1 website:

http://www.python.org/download/releases/3.1/

See PEP 375 for release schedule details:

http://www.python.org/dev/peps/pep-0375/



Enjoy,
-- Benjamin

Benjamin Peterson
benjamin at python.org
Release Manager
(on behalf of the entire python-dev team and 3.1's contributors)
 
B

bearophileHUGS

I appreciate the tables "Infinite Iterators" and "Iterators
terminating on the shortest input sequence" at the top of the
itertools module, they are quite handy. I'd like to see similar
summary tables at the top of other docs pages too (such pages are
often quite long), for example the collections docs page.


collections.Counter and collections.OrderedDict: very nice and useful.
Is the order inside OrderedDict kept with a double linked list of the
items?


Counter.most_common([n]): a good idea.


If I need a dictionary that is both ordered and has a default too I
can't combine their qualities (but I can use the __missing__(key)
hook).

Equality tests between OrderedDict objects are order-sensitive and are implemented as list(od1.items())==list(od2.items()). Equality tests between OrderedDict objects and other Mapping objects are order-insensitive<

very nice idea.

The OrderedDict constructor and update() method both accept keyword arguments, but their order is lost because Python's function call semantics pass-in keyword arguments using a regular unordered dictionary.<

This is unfortunate :-(
Well, I'd like function call semantics pass-in keyword arguments to
use OrderedDicts then... :)

Several mathematical operations are provided for combining Counter objects to produce multisets<

Very nice.


itertools.count(): when increments are non-integer I hope the results
are computed with a multiplication instead an interated sum, to
increase precision.


Issue 4688 and the work by Antoine Pitrou: interesting GC
optimization. The performance difference of the BinaryTrees benchmark
is big.

Bye,
bearophile
 
P

pruebauno

On behalf of the Python development team, I'm thrilled to announce the first and
only beta release of Python 3.1.

Python 3.1 focuses on the stabilization and optimization of features and changes
Python 3.0 introduced.  For example, the new I/O system has been rewritten in C
for speed.  File system APIs that use unicode strings now handle paths with
undecodable bytes in them. [1] Other features include an ordered dictionary
implementation and support for ttk Tile in Tkinter.  For a more extensive list
of changes in 3.1, seehttp://doc.python.org/dev/py3k/whatsnew/3.1.htmlor
Misc/NEWS in the Python distribution.

Please note that this is a beta release, and as such is not suitable for
production environments.  We continue to strive for a high degree of quality,
but there are still some known problems and the feature sets have not been
finalized.  This beta is being released to solicit feedback and hopefully
discover bugs, as well as allowing you to determine how changes in 3.1 might
impact you.  If you find things broken or incorrect, please submit a bug report
at

   http://bugs.python.org

For more information and downloadable distributions, see the Python 3.1 website:

   http://www.python.org/download/releases/3.1/

See PEP 375 for release schedule details:

   http://www.python.org/dev/peps/pep-0375/

Enjoy,
-- Benjamin

Benjamin Peterson
benjamin at python.org
Release Manager
(on behalf of the entire python-dev team and 3.1's contributors)


Congratulations!

Is it just me or was some nice summary output added to the make
process? I get a nice list of modules that didn't compile and the ones
where the library could not be found.
 
T

Terry Reedy

Is the order inside OrderedDict kept with a double linked list of the
items?

That is one of the things Raymond tried. Check the code for what he
settled on for the Python version. I believe he thinks the best C
implementation might be different from the best Python version.
This is unfortunate :-(
Well, I'd like function call semantics pass-in keyword arguments to
use OrderedDicts then... :)

This possibility has been discussed on pydev.
It would require a sufficiently fast C implementation.

tjr
 
P

pruebauno

very nice idea.

I don't know if somebody else is interested but I wouldn't mind
support to OrderedDict and namedtuple in the csv module:

Have csv.DictReader return an OrderedDict instead of a regular one
(based on the order of the column names in the header line).

Have csv.DictWriter accept an OrderedDict. That would take care of
this:

"Note that unlike the DictReader class, the fieldnames parameter of
the DictWriter is not optional. Since Python’s dict objects are not
ordered, there is not enough information available to deduce the order
in which the row should be written to the csvfile."
http://docs.python.org/dev/py3k/library/csv.html#csv.DictWriter

Add a new csv.NamedTupleReader and csv.NamedTupleWriter that work
similar to the DictReader and DictWriter then this snippet (in
examples http://docs.python.org/dev/py3k/library/collections.html#collections.namedtuple
):

EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title,
department, paygrade')
import csv
for emp in map(EmployeeRecord._make, csv.reader(open("employees.csv",
"rb"))):
print(emp.name, emp.title)

Could be rewritten as:

import csv
for emp in csv.NamedTupleReader("employees.csv"):
print(emp.name, emp.title)


Also, is there a way to convert a OrderedDict into a namedtuple? It is
possible to go the other direction using namedtuple._asdict, but I
don't see a _fromdict method.

And thanks Steven and Raymond for the Counter class. Several people
had started to see the common pattern and now we have it in the
stdlib.
 
B

bearophileHUGS

Terry Reedy:
bearophile:
Well, I'd like function call semantics pass-in keyword arguments to
use OrderedDicts then... :)
[...]
It would require a sufficiently fast C implementation.

Right.
Such dict is usually small, so if people want it ordered, it may be
better to just use an array of name-value structs instead of a dict or
ordered dict. Iterating on a 10-pair array is fast on modern CPUs.

Bye,
bearophile
 
B

Benjamin Peterson

Congratulations!
Thanks!


Is it just me or was some nice summary output added to the make
process? I get a nice list of modules that didn't compile and the ones
where the library could not be found.

Are you compiling on a different platform? The nice output has been around for a
while, bu only on non-Windows platforms.
 
B

Benjamin Peterson

collections.Counter and collections.OrderedDict: very nice and useful.
Is the order inside OrderedDict kept with a double linked list of the
items?

There's a doubly-linked list containing the values. Another dictionary maps keys
to the list.
 
P

pruebauno

Are you compiling on a different platform? The nice output has been around for a
while, bu only on non-Windows platforms.

Not really, I was on AIX. It is probably just me then, probably
because for the first time I see it making it through the whole
process even with the Tkinter libraries missing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top