Josiah Carlson wrote:
Greg Ewing [EMAIL PROTECTED] wrote:
u = unicode(b)
u = unicode(b, 'utf8')
b = bytes['utf8'](u)
u = unicode['base64'](b) # encoding
b = bytes(u, 'base64') # decoding
u2 = unicode['piglatin'](u1) # encoding
u1 = unicode(u2, 'piglatin') #
[Tim Peters]
...
Only obmalloc.c is changed in that branch, and you can get it directly from:
http://svn.python.org/view/python/branches/tim-obmalloc/Objects/obmalloc.c?rev=42760view=log
Heck no -- sorry, that pins it to an out-of-date revision. Use the shorter
Tim Peters wrote:
For simpler fun, run this silly little program, and look at memory
consumption at the prompts:
x = []
for i in xrange(100):
x.append([])
raw_input(full )
del x[:]
raw_input(empty )
For example, in a release build on WinXP, VM size is about 48MB at the
full
The following code leaks a reference. Original test case from
Lib/test/test_sys.py in test_original_excepthook.
import sys, StringIO
eh = sys.__excepthook__
try:
raise ValueError(42)
except ValueError, exc:
exc_type, exc_value, exc_tb = sys.exc_info()
eh(exc_type, None, None)
Ron Adam wrote:
Josiah Carlson wrote:
Greg Ewing [EMAIL PROTECTED] wrote:
u = unicode(b)
u = unicode(b, 'utf8')
b = bytes['utf8'](u)
u = unicode['base64'](b) # encoding
b = bytes(u, 'base64') # decoding
u2 = unicode['piglatin'](u1) # encoding
u1 =
Greg Ewing wrote:
Baptiste Carvello wrote:
while manipulating binary data will happen mostly with bytes objects, some
operations are better done with ints, like the bit manipulations with the
|~^
operators.
Why not just support bitwise operations directly
on the bytes object?
+1!
On Thu, Mar 02, 2006, Neal Norwitz wrote:
The following code leaks a reference. Original test case from
Lib/test/test_sys.py in test_original_excepthook.
Did you submit a SF bug report?
--
Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/
19. A language that doesn't
On Wed, Mar 01, 2006, Guido van Rossum wrote:
Operations with two or more arguments are often better expressed as
function calls -- for example, map() and filter() don't make much
sense as methods on callables or sequences.
OTOH, my personal style is to always use re.compile() because I can
On Thu, Mar 02, 2006 at 01:43:00AM -0600, Tim Peters wrote:
I'm optimistic, because the new test compares a quantity already being
tested by the macro, a second time against 0, and it's hard to get
cheaper than that. However, the new branch isn't predictable, so who
knows?
When compiling
Neal I'll do this, except there are some issues:
Neal * Lib/reconvert.py imports regex. Ok to move regex,regsub,recovert
to lib-old?
Neal * ./Demo/pdist/rcslib.py ./Demo/sockets/mcast.py import regsub
...
Neal * A whole mess of Demos and Tools use regex. What to do
On 3/2/06, Barry Warsaw [EMAIL PROTECTED] wrote:
On Thu, 2006-03-02 at 07:26 -0800, Aahz wrote:
OTOH, my personal style is to always use re.compile() because I can
never remember the order of arguments for re.match()/re.search().
Agreed.
I don't have that problem, because the order is the
[EMAIL PROTECTED] wrote:
The docstring shows how to use it. Yet another Andrew Kuchling gem
as I recall (or maybe an effbot gem).
amk, most likely.
and in 92.65% of all cases, switching from regex to re involves adding
\ in front of (, | and ) if they don't already have them, and removing \
On Thu, Mar 02, 2006, Guido van Rossum wrote:
On 3/2/06, Barry Warsaw [EMAIL PROTECTED] wrote:
On Thu, 2006-03-02 at 07:26 -0800, Aahz wrote:
OTOH, my personal style is to always use re.compile() because I can
never remember the order of arguments for re.match()/re.search().
Agreed.
I
[Tim Peters]
...
However, the new branch isn't predictable, so who knows?
[Nick Craig-Wood]
When compiling with gcc at least you could give the compiler a hint,
eg
http://kerneltrap.org/node/4705
By the new branch isn't predictable, I mean that there's apparently
no way to guess which
Ron Adam wrote:
This uses syntax to determine the direction of encoding. It would be
easier and clearer to just require two arguments or a tuple.
u = unicode(b, 'encode', 'base64')
b = bytes(u, 'decode', 'base64')
The point of the exercise was to avoid using the terms
Fredrik Lundh wrote:
someone also pointed out in private mail (I think; it doesn't seem to
have made it to this list) that CPython's extensive use of inheritance
by aggregation is invalid C.
switching to C++ would be one way to address that, of course.
A rather heavyweight solution to a
Greg Ewing a écrit :
Why not just support bitwise operations directly
on the bytes object?
Sure, what counts is that all the nice features that Python has for editing
binary data are usable with the bytes object.
These include bitwise operations, hex() and oct() representation functions and
Stephen J. Turnbull wrote:
What you presumably meant was what would you consider the proper type
for (P)CDATA?
No, I mean the whole thing, including all the ... tags
etc. Like you see when you load an XML file into a text
editor. (BTW, doesn't the fact that you *can* load an
XML file into what
Zitat von Fredrik Lundh [EMAIL PROTECTED]:
I'm not saying Python 3 should be written in C++, I'm only saying
that doing so would have not just disadvantages.
someone also pointed out in private mail (I think; it doesn't seem to
have made it to this list) that CPython's extensive use of
Zitat von Greg Ewing [EMAIL PROTECTED]:
A rather heavyweight solution to a problem that does
not seem to have been a problem in practice so far,
only in theory.
The problem does exist in practice. Python is deliberately
build with -fno-strict-aliasing when GCC is used, and might
get compiled
Zitat von Stephen J. Turnbull [EMAIL PROTECTED]:
martin - increased type-safety, in particular for API that isn't
martin type-checked at all at the moment (e.g. PyArg_ParseTuple)
That's merely an advantage to having a C++ *compiler*. No need to
actually use the C++ *language*. :-)
Greg == Greg Ewing [EMAIL PROTECTED] writes:
Greg (BTW, doesn't the fact that you *can* load an XML file into
Greg what we call a text editor say something?)
Why not answer that question for yourself, and then turn that answer
into a description of text semantics?
For me, it says that,
22 matches
Mail list logo