September 29, 2007 at 2:45 pm · tags: Python Python SVN
Added utility function to ssl module, get_server_certificate,
to wrap up the several things to be done to pull a certificate
from a remote server.
Optimize performance of cgi.FieldStorage operations.
Added os.environ.clear() method: will unset all the environment variables.
September 22, 2007 at 5:08 pm · tags: Python
I ran the benchmark again with the 1014 revision of html5lib and I noticed a major speedup (altough miles far from the other libraries) in parsing.
The benchmark itself ran in roughly 262 seconds instead of the previous roughly 457. 57% faster.
These are the numbers on the 30 of August:
html5lib.HTMLParser, only HTML - time: 209.537359953, errors: 6019
html5lib.HTMLParser, only XML - time: 247.377570152, errors: 15566
Total: 456.914930
These come from today:
html5lib.HTMLParser, only HTML - time: 97.3409409523, errors: 6019
html5lib.HTMLParser, only XML - time: 164.554941893, errors: 15566
Total: 261.895883
This is the profiling:
582972 function calls (579727 primitive calls) in 2.196 CPU seconds
Ordered by: cumulative time
ncalls tottime percall cumtime percall filename:lineno(function)
1 0.000 0.000 2.196 2.196 {execfile}
1 0.049 0.049 2.196 2.196 html5lib_profile.py:1(module)
1 0.002 0.002 1.584 1.584 html5lib_profile.py:3(html5lib_parse)
1 0.000 0.000 1.580 1.580 html5parser.py:130(parse)
1 0.053 0.053 1.580 1.580 html5parser.py:76(_parse)
6832 0.071 0.000 1.173 0.000 tokenizer.py:88(__iter__)
8216 0.572 0.000 0.686 0.000 inputstream.py:249(charsUntil)
1 0.038 0.038 0.512 0.512 __init__.py:13(module)
6763 0.061 0.000 0.477 0.000 tokenizer.py:298(dataState)
1 0.029 0.029 0.439 0.439 html5parser.py:7(module)
1 0.088 0.088 0.312 0.312 treebuilders/simpletree.py:1(module)
2059 0.013 0.000 0.294 0.000 tokenizer.py:585(attributeValueDoubleQuotedState)
1 0.039 0.039 0.196 0.196 saxutils.py:4(module)
1 0.090 0.090 0.156 0.156 urllib.py:23(module)
September 16, 2007 at 10:51 pm · tags: Python Python SVN
Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> def f(): yield 1
…
>>> a = f()
>>> a.throw(“error”)
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “<stdin>”, line 1, in f
error
>>>
Python 2.6a0 (trunk:58159M, Sep 15 2007, 13:43:25)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.
>>> def f(): yield 1
…
>>> a = f()
>>> a.throw(“error”)
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
TypeError: exceptions must be classes, or instances, not str
September 13, 2007 at 11:15 am · tags: Misc
I’m pleased to announce that Packt Publishing has launched a new community driven website to help people with installation issues for the various applications and frameworks we use every day. The site is wiki based so it can be further expanded. Here below follows a copy of the official press release:
September 2007
New Website Launched that Promises to ease the Software Installation Process
InstallationWiki.org is a new website designed to provide users with comprehensive, free guides to installing software. The website will largely be driven and populated by content supplied and edited by experts, and hopes to bridge the gap between software experts and software users.
Quality, relevant and free information on installing software is often difficult to find, especially when new versions and editions are being released on a regular basis. The aim of InstallationWiki.org is to provide people with a one-stop source of information for installing whichever piece of software they’re working with.
The Installation Wiki will provide myriad benefits for a variety of individuals; acting as a resource for software users, whilst supporting the software community through gaining exposure for their respective programs.
InstallationWiki.org has been developed using the open source MediaWiki software package and is supported by UK publisher Packt. The site has initially been populated using installation chapters from Packt books. “We’re more than happy to provide InstallationWiki.org with content from our books” explains Packt spokesman, Damian Carvill. “Packt is pleased to support the idea of providing an online repository of guides for installing software and we’re honored to populate the Wiki with its first content” he adds.
InstallationWiki.org is inviting software experts to share their knowledge by adding to the content on the site, helping it grow into an exhaustive library whilst increasing their position of authority in the subject.
InstallationWiki.org is free to use and open for everyone to contribute to. It is expected to grow and expand over the coming months with more installation guides and features. For more information, please visit www.InstallationWiki.org.
September 2, 2007 at 10:08 pm · tags: JobLife Python
I’ve been recently hired by StatPro PLC to work full time in their offices here in Milan as a Python developer (of course :-)).
Tomorrow will be the first day!
One of my colleagues is Michele Simionato so you can imagine how much I’m excited
September 1, 2007 at 5:48 pm · tags: Python Python SVN
Some news from the Python trunk:
Server-side SSL support and certificate verification. See the doc.
The functools module now provides reduce, for forward compatibility with Python 3000.
Extended slicing support in builtin types and classes has been improved:
Specialcase extended slices that amount to a shallow copy the same way as is done for simple slices, in the tuple, string and unicode case.
Specialcase step-1 extended slices to optimize the common case for all involved types.
For lists, allow extended slice assignment of differing lengths as long as the step is 1. (previously, ‘l[:2:1] = []’ failed even though ‘l[:2] = []’ and ‘l[:2:None] = []’ do not)
Implement extended slicing for buffer, array, structseq, mmap and UserString.UserString.
Implement slice-object support (but not non-step-1 slice assignment) for UserString.MutableString.
socket.ssl deprecated; use new ssl module instead.
httplib.FakeSocket is deprecated.