[Python-3000] Release Countdown

Guido van Rossum guido at python.org
Fri Aug 31 23:03:46 CEST 2007


On 8/31/07, Jim Jewett <jimjjewett at gmail.com> wrote:
> On 8/31/07, Guido van Rossum <guido at python.org> wrote:
>
> > > >>>> For me on OS X, I'm still getting a failure in test_plistlib and an
>
> > No worry, I cracked it, just in time before the release.
>
> Seeing the recent changes to plistlib does make me think that bytes is
> more awkward than it should be.  The changes I would suggest:
>
> (1)  Allow bytes methods to take a literal string (which will
> obviously be in the source file's encoding).

Yuck, yuck about the source file encoding part. Also, there is no way
to tell that a particular argument was passed a literal. The very
definition of "this was a literal" is iffy -- is x a literal when
passed to f below?

  x = "abc"
  f(x)

> Needing to change
>
>     for line in data.asBase64(maxlinelength).split("\n"):
> to
>     for line in data.asBase64(maxlinelength).split(b"\n"):
>
> (even when I know the "integers" represent ASCII letters) is exactly
> the sort of type-checking that annoys me in Java.
>
> http://svn.python.org/view/python/branches/py3k/Lib/plat-mac/plistlib.py?rev=57844&r1=57744&r2=57844
>
>
> (2)  There really ought to be an immutable bytes type, and the literal
> (or at least a literal, if capitalization matters) ought to be the
> immutable.
>
> PLISTHEADER = b"""\
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD
> PLIST 1.0//EN" "http://www.apple.com/DTDs/
> PropertyList-1.0.dtd">
> """
>
> If the value of PLISTHEADER does change during the run, it will almost
> certainly be a bug.  I could code defensively by only ever passing
> copies, but that seems wasteful, and it could hide other bugs.  If
> something does try to modify (not replace, modify) it, then there was
> probably a typo or API misunderstanding; I *want* an exception.

Sounds like you're worrying to much. Do you have any indication that
this is going to be a common problem?
> http://svn.python.org/view/python/branches/py3k/Lib/plat-mac/plistlib.py?rev=57563&r1=57305&r2=57563
>
> -jJ
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list