inicio mail me! sindicaci;ón

Archive for September, 2007

Updates from Python SVN, Part 16

  • 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.

html5lib is getting faster

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)

Updates from Python SVN, Part 15

  • Added support for linking the bsddb module against BerkeleyDB 4.5.x and 4.6.x.

  • Added set_completion_display_matches_hook and get_completion_type to readline module.

  • Added a c_longdouble type to the ctypes module.

  • abc.py and isinstance/issubclass overloading have been backported. See PEP 3119 for details about Abstract Base Classes.

  • generator’s throw() doesn’t support string exceptions anymore:

  1. Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04)
  2. [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
  3. Type “help”, “copyright”, “credits” or “license” for more information.
  4. >>> def f(): yield 1
  5. >>> a = f()
  6. >>> a.throw(“error”)
  7. Traceback (most recent call last):
  8.   File “<stdin>”, line 1, in <module>
  9.   File “<stdin>”, line 1, in f
  10. error
  11. >>>
  12.  
  13. Python 2.6a0 (trunk:58159M, Sep 15 2007, 13:43:25)
  14. [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
  15. Type “help”, “copyright”, “credits” or “license” for more information.
  16. >>> def f(): yield 1
  17. >>> a = f()
  18. >>> a.throw(“error”)
  19. Traceback (most recent call last):
  20.   File “<stdin>”, line 1, in <module>
  21. TypeError: exceptions must be classes, or instances, not str

InstallationWiki website launched

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.

New job

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 :-D

Updates from Python SVN, Part 14

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.