Hi everyone,
I think Py3.3 would be a good milestone for cleaning up the stdlib support
for XML. Note upfront: you may or may not know me as the maintainer of
lxml, the de-facto non-stdlib standard Python XML tool. This (lengthy) post
was triggered by the following kind of conversation that I
Given that WSGI 1.0.1 is defined in terms of native strings and restoring
u'' support allows that to be expressed clearly in a shared codebase, I at
least understand the point of the suggestion now. I'm not quite convinced
restoring u'' is the right answer as yet, but a solid use case is always a
Sorry, I don't understand this. What does it mean to be str in both
versions? And why would you want that?
One use case (and the only one I'm aware of) is to pass keyword
parameters. Python 2 insists that they are str (and doesn't accept
unicode), Python 3 insists that they are str (and
They fail to hear the again in that sentence. I've clearly already
thought about the distinction between bytes and text at least once:
that's *why* I'm using a u'' literal there. I shouldn't have to think
about it again to service syntax constraints. Code that is more
explicit than
Or, alternatively, you use 'six' (or a similar compatibility module)
and ensure unicode at runtime, using native or binary strings
otherwise:
--
from six import u
foo = u(this is a Unicode string in both Python 2.x and 3.x)
bar = this is an 8-bit string in Python 2.x and a Unicode
a) The stdlib documentation should help users to choose the right tool
right from the start. Instead of using the totally misleading wording
that it uses now, it should be honest about the performance
characteristics of MiniDOM and should actively suggest that those who
don't know what to
Am 09.12.2011 01:35, schrieb Antoine Pitrou:
On Fri, 09 Dec 2011 00:16:02 +0100
victor.stinner python-check...@python.org wrote:
+.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode)
+
+ Get a new copy of a Unicode object.
+
+ .. versionadded:: 3.3
I'm not sure I
Martin v. Löwis, 09.12.2011 09:41:
a) The stdlib documentation should help users to choose the right tool
right from the start. Instead of using the totally misleading wording
that it uses now, it should be honest about the performance
characteristics of MiniDOM and should actively suggest that
On Fri, 9 Dec 2011 15:30:36 +1000
Nick Coghlan ncogh...@gmail.com wrote:
Or, alternatively, you use 'six' (or a similar compatibility module)
and ensure unicode at runtime, using native or binary strings
otherwise:
--
from six import u
foo = u(this is a Unicode string in both
On 2011-12-09, at 09:41 , Martin v. Löwis wrote:
a) The stdlib documentation should help users to choose the right tool
right from the start. Instead of using the totally misleading wording
that it uses now, it should be honest about the performance
characteristics of MiniDOM and should
On Fri, Dec 9, 2011 at 6:41 PM, Martin v. Löwis mar...@v.loewis.de wrote:
a) The stdlib documentation should help users to choose the right tool
right from the start. Instead of using the totally misleading wording
that it uses now, it should be honest about the performance
characteristics of
On Fri, Dec 9, 2011 at 6:44 PM, Martin v. Löwis mar...@v.loewis.de wrote:
Am 09.12.2011 01:35, schrieb Antoine Pitrou:
On Fri, 09 Dec 2011 00:16:02 +0100
victor.stinner python-check...@python.org wrote:
+.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode)
+
+ Get a new copy of a
Mostly uninformed +1 to Stefan's suggestions from me.
Regards
Antoine.
On Fri, 09 Dec 2011 09:02:35 +0100
Stefan Behnel stefan...@behnel.de wrote:
Hi everyone,
I think Py3.3 would be a good milestone for cleaning up the stdlib support
for XML. Note upfront: you may or may not know me
On 12/8/2011 8:39 PM, Vinay Sajip wrote:
It's not the speed of 2to3 per se; this seems very reasonable for a
tool of its type It's the overall process, which currently involves
running 2to3
on an
entire codebase (for example, using setup.py with flags to run 2to3
during setup).
Oh. That
On Fri, Dec 9, 2011 at 8:03 PM, Terry Reedy tjre...@udel.edu wrote:
On 12/8/2011 8:39 PM, Vinay Sajip wrote:
on an
entire codebase (for example, using setup.py with flags to run 2to3
during setup).
Oh. That explains the 'slow' complaint.
As Chris pointed out though, the real problem with
On Fri, 9 Dec 2011 15:41:40 +1000
Nick Coghlan ncogh...@gmail.com wrote:
On Fri, Dec 9, 2011 at 3:33 PM, Chris McDonough chr...@plope.com wrote:
Even if it weren't slow, I still wouldn't use it to automatically
convert code at install time; a single codebase is easier to reason
about, and
On Fri, Dec 9, 2011 at 03:53, Guido van Rossum gu...@python.org wrote:
Are you saying that with that future import, b... is still a Unicode
literal?
If I said that, this is not what I was trying to say. :-)
//Lennart
___
Python-Dev mailing list
Nick Coghlan writes:
So, instead of attempting to paper over the problem by reintroducing
u'', perhaps the discussion we should be having is whether or not PEP
's superficially appealing concept of defining an API in terms of
native strings is a loser in practice,
+1
to that
On Fri, Dec 9, 2011 at 04:34, Barry Warsaw ba...@python.org wrote:
Sorry, I don't understand this. What does it mean to be str in both
versions? And why would you want that?
It means that it's a str, that is a string of bytes, in Python 2, and
a str, that is a string of Unicode characters, in
Chris McDonough writes:
Given an effective choice between enabling six lines of code in Python
3.3 to support u'' and months of political wrangling and code rewriting,
I'll choose the former any day.
Sure, but the real question is whether that *is* the effective choice.
Maybe the effective
Hey python-devers,
As I'm sure many of you are aware, Armin Ronacher posted a blog entry
explaining the reasons he dislikes Python 3 in its current form.
Whilst I don't agree with all of his complaints, he makes a fair point about
the re module Unicode support. It seems that the specific
Slightly OT:
The slowness of running 2to3 during install time can be fixed by not
doing so, but instead running it when the distribution is created,
including both Python 2 and Python 3 code in the distribution.
http://python3porting.com/2to3.html#distribution-section
There are no tools that
On Fri, 9 Dec 2011 14:42:43 +
Michael Foord fuzzy...@voidspace.org.uk wrote:
Whilst I don't agree with all of his complaints, he makes a fair point about
the re module Unicode support. It seems that the specific issue he has could
be fixed by accepting the re module improvement /
On Fri, Dec 9, 2011 at 09:02, Stefan Behnel stefan...@behnel.de wrote:
a) The stdlib documentation should help users to choose the right tool right
from the start.
b) cElementTree should finally loose it's special status as a separate
library and disappear as an accelerator module behind
On Dec 09, 2011, at 03:18 PM, Lennart Regebro wrote:
On Fri, Dec 9, 2011 at 04:34, Barry Warsaw ba...@python.org wrote:
Sorry, I don't understand this. What does it mean to be str in both
versions? And why would you want that?
It means that it's a str, that is a string of bytes, in Python 2,
On Dec 09, 2011, at 09:20 AM, Martin v. Löwis wrote:
One use case (and the only one I'm aware of) is to pass keyword
parameters. Python 2 insists that they are str (and doesn't accept
unicode), Python 3 insists that they are str (and doesn't accept bytes).
This is fairly uncommon as a problem,
On Dec 09, 2011, at 06:09 PM, Nick Coghlan wrote:
Given that WSGI 1.0.1 is defined in terms of native strings and restoring
u'' support allows that to be expressed clearly in a shared codebase, I at
least understand the point of the suggestion now. I'm not quite convinced
restoring u'' is the
On 9 Dec 2011, at 15:13, Barry Warsaw wrote:
On Dec 09, 2011, at 09:20 AM, Martin v. Löwis wrote:
One use case (and the only one I'm aware of) is to pass keyword
parameters. Python 2 insists that they are str (and doesn't accept
unicode), Python 3 insists that they are str (and doesn't
On Dec 09, 2011, at 07:12 PM, Nick Coghlan wrote:
Isn't it basically just exposing a C level version of the unicode()
builtin's behaviour? While I agree the name could be better (and
PyUnicode_AsExactUnicode would certainly work), why make it private?
Don't we already have that in
On 12/09/2011 08:35 AM, Michael Foord wrote:
On 9 Dec 2011, at 15:13, Barry Warsaw wrote:
Oh, I remember this one, because I think I reported and fixed it.
But I take it as a given that Python 2.6 is the minimal (sane)
version to target for one-codebase cross-Python code.
In mock (at
On Thu, 08 Dec 2011 13:27:20 +0100, Barry Warsaw ba...@python.org wrote:
On Dec 08, 2011, at 11:01 AM, Vinay Sajip wrote:
Well, if 3.2 remains in use for a longish time, then it is relevant, in
the
broader context, isn't it? We know how conservative Linux
distributions can
be with their
Hi,
When running 2to3 from a setup.py script, does it run on the whole
codebase or only files that are found newer by the make-like
timestamp-based dependency system? If it’s the former, as some messages
seem to show (sorry no time to test right now), ISTM we can fix
distutils to do the latter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 12/09/2011 07:45 AM, Lennart Regebro wrote:
The slowness of running 2to3 during install time can be fixed by not
doing so, but instead running it when the distribution is created,
including both Python 2 and Python 3 code in the distribution.
On Fri, 09 Dec 2011 17:38:56 +0100
Éric Araujo mer...@netwok.org wrote:
Hi,
When running 2to3 from a setup.py script, does it run on the whole
codebase or only files that are found newer by the make-like
timestamp-based dependency system? If it’s the former, as some messages
seem to show
+1
On Sat, Dec 10, 2011 at 2:09 AM, Dirkjan Ochtman dirk...@ochtman.nl wrote:
On Fri, Dec 9, 2011 at 09:02, Stefan Behnel stefan...@behnel.de wrote:
a) The stdlib documentation should help users to choose the right tool right
from the start.
b) cElementTree should finally loose it's special
ACTIVITY SUMMARY (2011-12-02 - 2011-12-09)
Python tracker at http://bugs.python.org/
To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.
Issues counts and deltas:
open3169 (+21)
closed 22180 (+26)
total 25349 (+47)
Open issues
Michael Foord fuzzy...@voidspace.org.uk wrote:
Hey python-devers,
As I'm sure many of you are aware, Armin Ronacher posted a blog entry
explaining the reasons he dislikes Python 3 in its current form.
Whilst I don't agree with all of his complaints, he makes a fair point
about the re
On Fri, 09 Dec 2011 09:02:35 +0100
Stefan Behnel stefan...@behnel.de wrote:
a) The stdlib documentation should help users to choose the right
tool right from the start.
b) cElementTree should finally loose it's special status as a
separate library and disappear as an accelerator module behind
Mike Meyer m...@mired.org wrote:
On Fri, 09 Dec 2011 09:02:35 +0100
Stefan Behnel stefan...@behnel.de wrote:
a) The stdlib documentation should help users to choose the right
tool right from the start.
b) cElementTree should finally loose it's special status as a
separate library and
On 9 December 2011 18:15, Bill Janssen jans...@parc.com wrote:
I use ElementTree for parsing valid XML, but minidom for producing it.
I think another thing that might go into refreshing the batteries is a
feature comparison of BeautifulSoup and HTML5lib against the stdlib
competition, to see
On Dec 9, 2011, at 12:43 AM, Guido van Rossum wrote:
Even if it weren't slow, I still wouldn't use it to automatically
convert code at install time; a single codebase is easier to reason
about, and easier to support. Users send me tracebacks all the time;
having them match the source is a
On 2011-12-09, at 19:15 , Bill Janssen wrote:
I use ElementTree for parsing valid XML, but minidom for producing it.
Could you expand on your reasons to use minidom for producing XML?
___
Python-Dev mailing list
Python-Dev@python.org
On 09/12/2011 01:35, Antoine Pitrou wrote:
On Fri, 09 Dec 2011 00:16:02 +0100
victor.stinnerpython-check...@python.org wrote:
+.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode)
+
+ Get a new copy of a Unicode object.
+
+ .. versionadded:: 3.3
I'm not sure I understand. Why
hi devs,
just an idea that popped up in my mind: re.findall() returns a list of
tuples, where every entry of each tuple represents a match group.
since match groups can be named, we are able to use named tuples instead of
plain tuples here, in the same fashion as namedtuple’s rename works:
Xavier Morel python-...@masklinn.net wrote:
On 2011-12-09, at 19:15 , Bill Janssen wrote:
I use ElementTree for parsing valid XML, but minidom for producing it.
Could you expand on your reasons to use minidom for producing XML?
Inertia, I guess. I tried that first, and it seems to work.
I
On Fri, 09 Dec 2011 19:51:14 +0100
Victor Stinner victor.stin...@haypocalc.com wrote:
On 09/12/2011 01:35, Antoine Pitrou wrote:
On Fri, 09 Dec 2011 00:16:02 +0100
victor.stinnerpython-check...@python.org wrote:
+.. c:function:: PyObject* PyUnicode_Copy(PyObject *unicode)
+
+ Get a
On Fri, Dec 9, 2011 at 10:11 AM, Barry Warsaw ba...@python.org wrote:
As Chris points out, this seems to be a use case tied to WSGI and PEP
. I
guess it's an unfortunate choice for so recent a PEP, but maybe there was
no
way to do better.
For the record, native strings are defined the
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
Otherwise, read on.
I know very well that this topic has been
On Fri, Dec 9, 2011 at 14:26, Cedric Sodhi man...@gmx.net wrote:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
On Fri, Dec 9, 2011 at 17:38, Éric Araujo mer...@netwok.org wrote:
When running 2to3 from a setup.py script, does it run on the whole
codebase or only files that are found newer by the make-like
timestamp-based dependency system?
Only on the ones that are newer. But since at install time,
On Friday, December 9, 2011 at 3:26 PM, Cedric Sodhi wrote:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
On 2011-12-09, at 21:26 , Cedric Sodhi wrote:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
Otherwise, read on.
Cedric Sodhi man...@gmx.net writes:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
If you're going to post a long
On Fri, 9 Dec 2011 21:26:29 +0100
Cedric Sodhi man...@gmx.net wrote:
Readable code, is it really an advantage?
Of course it is.
Ok, you got that right.
Forcing the programmer to write readable code, is that an advantage?
No suspense, the answer is Of course not.
This is *not* an Of course.
On Fri, Dec 09, 2011 at 01:11:29PM -0800, Mike Meyer wrote:
On Fri, 9 Dec 2011 21:26:29 +0100
Cedric Sodhi man...@gmx.net wrote:
Readable code, is it really an advantage?
Of course it is.
Ok, you got that right.
Thank you. It doesn't go unnoticed that you learned your Feedback Rules.
Dear Cedric,
I'm guessing you drank too much (perhaps you are training for New Year's
Eve), ate some bad sausages or are simply very self-complacent.
python-dev is not the place where to post long unstructured ramblings
with no practical value. Consider writing on your personal blog
instead.
This belongs on python-ideas. Please take it there.
~Ethan~
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
I don't always post to python-dev, but when I do I ask for braces.
On Friday, December 9, 2011 at 4:43 PM, Antoine Pitrou wrote:
Dear Cedric,
I'm guessing you drank too much (perhaps you are training for New Year's
Eve), ate some bad sausages or are simply very self-complacent.
You've really only given one reason why braces are a good idea:
I also appreciate single lined conditional or loops once in a while.
Not only is this argument even weaker than the two you yourself gave in
defense of whitespace, these two features are already supported in Python.
If you're not
On Fri, Dec 9, 2011 at 12:26 PM, Cedric Sodhi man...@gmx.net wrote:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
DOESN'T LIKE IT IS FREE TO CHOOSE ANOTHER LANGUAGE OR SOMETHING
SIMILAR, JUST DON'T.
On Fri, Dec 09, 2011 at 02:21:42PM -0800, Guido van Rossum wrote:
On Fri, Dec 9, 2011 at 12:26 PM, Cedric Sodhi [1]man...@gmx.net wrote:
IF YOU THINK YOU MUST REPLY SOMETHING WITTY, ITERATE THAT THIS HAD BEEN
DISCUSSED BEFORE, REPLY THAT IT'S SIMPLY NOT GO'NNA HAPPEN, THAT WHO
If braces were introduced I would switch to Haskell, I can't stand the
noise. If you want to see a language that allows both whitespace, semi
colons and braces take a look at it. Nails it.
On Dec 10, 2011 9:31 AM, Cedric Sodhi man...@gmx.net wrote:
On Fri, Dec 09, 2011 at 02:21:42PM -0800, Guido
I second this. The doco is very bad.
On Dec 10, 2011 6:34 AM, Bill Janssen jans...@parc.com wrote:
Xavier Morel python-...@masklinn.net wrote:
On 2011-12-09, at 19:15 , Bill Janssen wrote:
I use ElementTree for parsing valid XML, but minidom for producing it.
Could you expand on your
I reply to your contribution mainly because I see another, valid
argument hidden in what you formulated as an opinion:
Readability would be reduced by such noise. To anticipate other people
agreeing with that, let me say, that it would be exactly one more
character, and the same amount of key
Point of order (repeated), please move this thread to python-ideas.
--
--Guido van Rossum (python.org/~guido)
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
Glyph glyph at twistedmatrix.com writes:
The biggest issue for the single-codebase approach is 'except ... as ...'.
Peppering one's codebase with calls to sys.exc_info() can be a real
performance problem, especially on PyPy. Not to mention how ugly it is.
For some reason I thought that this
Guido van Rossum wrote:
Point of order (repeated), please move this thread to python-ideas.
Isn't that cruel to the people reading python-ideas?
--
Steven
___
Python-Dev mailing list
Python-Dev@python.org
Ditch the colon too. Also you're a troll.
On Dec 10, 2011 9:58 AM, Cedric Sodhi man...@gmx.net wrote:
I reply to your contribution mainly because I see another, valid
argument hidden in what you formulated as an opinion:
Readability would be reduced by such noise. To anticipate other people
On Sat, Dec 10, 2011 at 00:43, Matt Joiner anacro...@gmail.com wrote:
I second this. The doco is very bad.
It would be constructive to open issues for specific problems in the
documentation. I'm sure this won't be hard to fix. Documentation should not
be the roadblock for using a library.
Eli
On 12/8/2011 8:31 AM, Philipp A. wrote:
hi devs,
just an idea that popped up in my mind: re.findall() returns a list of
tuples, where every entry of each tuple represents a match group.
since match groups can be named, we are able to use named tuples instead
of plain tuples here, in the same
On 12/9/2011 5:17 AM, Nick Coghlan wrote:
As Chris pointed out though, the real problem with the repeatedly run
2to3 workflow is that it can make interpreting tracebacks from the
field *really* hard.
This just gave me the idea of tagging tracebacks with the Python version
number. Something
On Sat, Dec 10, 2011 at 5:58 AM, PJ Eby p...@telecommunity.com wrote:
In fact, I'm not sure why people are bringing it into this discussion at
all: PEP was designed to work well with 2to3, which does the right
thing for WSGI code: it converts 2.x str to 3.x str, as it should. If
you're
Bill Janssen, 09.12.2011 19:15:
I think another thing that might go into refreshing the batteries is a
feature comparison of BeautifulSoup and HTML5lib against the stdlib
competition, to see what needs to be added/revised. Having to switch to
an outside package for parsing possibly invalid HTML
73 matches
Mail list logo