Re: pickle.load() extremely slow performance

2009-03-21 Thread Benjamin Peterson
Terry Reedy udel.edu> writes: > > 3.1a1 is out and I believe it has the io improvements. Massive ones, too. It'd be interesting to see your results on the alpha. -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.0 - bsddb removed

2009-03-22 Thread Benjamin Peterson
Sean att.net> writes: > > Anyone got any thoughts about what to use as a replacement. I need > something (like bsddb) which uses dictionary syntax to read and write an > underlying (fast!) btree or similar. pybsddb is just not included in the core. It's still distributed separately. http://w

Re: Script for a project inside own directory

2009-03-22 Thread Benjamin Peterson
Filip Gruszczyński gmail.com> writes: > I would like to ask if there is any workaround? Use the runpy module. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3, subclassing TextIOWrapper.

2009-03-22 Thread Benjamin Peterson
corning.com> writes: > Please, what is a better way to write the class with > regard to this issue? Set the original TextIOWrapper's buffer to None. -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3, subclassing TextIOWrapper.

2009-03-22 Thread Benjamin Peterson
Gabriel Genellina yahoo.com.ar> writes: > > There is another alternative that relies on undocumented behaviour: use > open to create a *binary* file and wrap the resulting BufferedReader > object in your own TextIOWrapper. How is that undocumented behavior? TextIOWrapper can wrap any buffer

what features would you like to see in 2to3?

2009-03-22 Thread Benjamin Peterson
It's GSoC time again, and I've had lots of interested students asking about doing on project on improving 2to3. What kinds of improvements and features would you like to see in it which student programmers could accomplish? -- http://mail.python.org/mailman/listinfo/python-list

Re: python 3, subclassing TextIOWrapper.

2009-03-22 Thread Benjamin Peterson
Gabriel Genellina yahoo.com.ar> writes: > > The undocumented behavior is relying on the open() builtin to return a > BufferedReader for a binary file. I don't see the problem. open() will return some BufferedIOBase implmentor, and that's all that TextIOWrapper needs. -- http://mail.python.

Re: python 3, subclassing TextIOWrapper.

2009-03-22 Thread Benjamin Peterson
Gabriel Genellina yahoo.com.ar> schrieb: > > How do you know? AFAIK, the return value of open() is completely > undocumented: > http://docs.python.org/3.0/library/functions.html#open > And if you open the file in text mode, the return value isn't a > BufferedIOBase. Oh, I see. I should chan

Re: what features would you like to see in 2to3?

2009-03-23 Thread Benjamin Peterson
Kay Schluehr gmx.net> writes: > > On 22 Mrz., 20:39, Benjamin Peterson wrote: > > It's GSoC time again, and I've had lots of interested students asking about > > doing on project on improving 2to3. What kinds of improvements and features > > woul

Re: Getting the type of an AST Node

2009-03-28 Thread Benjamin Peterson
Nick Edds uchicago.edu> writes: > > > Ahh sorry. This was in Python 2.5. There's still a builtin AST module in 2.5: _ast -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.1 alpha 2

2009-04-04 Thread Benjamin Peterson
http://www.python.org/dev/peps/pep-0375/ Regards, -- Benjamin Benjamin Peterson benjamin at python.org Release Manager (on behalf of the entire python-dev team and 3.1's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: possible pairings in a set

2009-04-04 Thread Benjamin Peterson
Ross gmail.com> writes: > Can you guys help me out? Do you have Python 2.6? If so, it's a solved problem. :) import itertools possible_pairings = list(itertools.combinations(players, 2)) -- http://mail.python.org/mailman/listinfo/python-list

Re: nonlocal in Python 2.6

2009-04-07 Thread Benjamin Peterson
Kay Schluehr gmx.net> writes: > > I always wondered about the decision to omit the nonlocal statement > from the Python 2.X series because it seems to be orthogonal to Python > 2.5. Are there any chances for it to be back ported? The only reason it was not backported was that either no one prov

Re: Python C API String Memory Consumption

2009-04-07 Thread Benjamin Peterson
Carl Banks gmail.com> writes: > However, Python apparently does leak a reference if passed a Unicode > object; PyArg_ParseTuple automatically creates an encoded string but > never decrefs it. (That might be necessary evil to preserve > compatibility, though. PyString_AS_STRING does it too.) Uni

Re: Can someone explain about the usage of unittest.TestSuite?

2009-04-09 Thread Benjamin Peterson
srinivasan srinivas yahoo.co.in> writes: > > > Hi, > I would like to know about the unittest.TestSuite clearly like at what situations i can use this TestSuite? > I am not getting the clear difference between this and unittest.TestCase. You write your actual tests with TestCase. A TestSuite st

Re: PyHeapTypeObject

2009-04-12 Thread Benjamin Peterson
Brendan Miller catphive.net> writes: > > What's the point of PyHeapTypeObject in Include/object.h? Why does the > layout of object types need to be different on the heap vs statically > allocated? Heap types have to do some extra book-keeping like garbage collection. -- http://mail.python.o

Re: OverflowError while sending large file via socket

2009-04-12 Thread Benjamin Peterson
Steven D'Aprano REMOVE-THIS-cybersource.com.au> writes: > > which suggests to me that it will be implementation dependent The length of sequences is constrained by sys.maxsize (and no, you can't change it). -- http://mail.python.org/mailman/listinfo/python-list

Re: What IDE support python 3.0.1 ?

2009-04-15 Thread Benjamin Peterson
Deep_Feelings gmail.com> writes: > > I want to start learning python and not wanna waste my time learning > python 2.x ,so i need your advise to what IDE to use for python 3.0.1 Why do you think you're wasting time with 2.x? -- http://mail.python.org/mailman/listinfo/python-list

Re: Interest in generational GC for Python

2009-04-19 Thread Benjamin Peterson
Borked Pseudo Mailed pseudo.borked.net> writes: > > Hello, > > Is there any interest in generational garbage > collection > in Python these days ? > > Anyone working on it ? The PyPy project has implemented more GC's than you want to think about including a ref counting gc, mark-sweep, and se

Re: Python and GMP.

2009-04-20 Thread Benjamin Peterson
gmail.com> writes: > > There are reasons why Python not used the GMP library for implementing > its long type? Basically, GMP only becomes faster when the numbers are huge. -- http://mail.python.org/mailman/listinfo/python-list

Re: is PyCodec_Encode() API returns New reference or Borrowed reference

2009-04-20 Thread Benjamin Peterson
rahul gmail.com> writes: > > Is PyCodec_Encode(PyObject *object,char *encoding,char *errors ) > returns New reference or Borrowed reference New -- http://mail.python.org/mailman/listinfo/python-list

Re: Weird lambda behavior

2009-04-22 Thread Benjamin Peterson
Chris Rebert rebertia.com> writes: > Common wart to run into as of late. fn (in the lambda) doesn't get > evaluated until the call-time of the lambda, by which point the loop > has finished and the loop variable has been changed to its final > value, which is used by the lambda. How is that a war

Re: Marshal vs pickle...

2009-04-25 Thread Benjamin Peterson
Lawson English cox.net> writes: > > Marshalling is only briefly mentioned in most python books I have, and > "pickling" is declared teh preferred method for serialization. > > I read somewhere that Marshalling is version-dependent while pickling is > not, but can't find that reference. OTOH,

[RELEASED] Python 3.1 beta 1

2009-05-06 Thread Benjamin Peterson
bsite: http://www.python.org/download/releases/3.1/ See PEP 375 for release schedule details: http://www.python.org/dev/peps/pep-0375/ Enjoy, -- Benjamin Benjamin Peterson benjamin at python.org Release Manager (on behalf of the entire python-dev team and 3.1's contributor

[RELEASED] Python 3.1 beta 1

2009-05-07 Thread Benjamin Peterson
bsite: http://www.python.org/download/releases/3.1/ See PEP 375 for release schedule details: http://www.python.org/dev/peps/pep-0375/ Enjoy, -- Benjamin Benjamin Peterson benjamin at python.org Release Manager (on behalf of the entire python-dev team and 3.1's contributor

Re: Python 3.1 beta 1

2009-05-07 Thread Benjamin Peterson
latinmail.com> writes: > Congratulations! Thanks! > > Is it just me or was some nice summary output added to the make > process? I get a nice list of modules that didn't compile and the ones > where the library could not be found. Are you compiling on a different platform? The nice output has

Re: Python 3.1 beta 1

2009-05-07 Thread Benjamin Peterson
lycos.com> writes: > > collections.Counter and collections.OrderedDict: very nice and useful. > Is the order inside OrderedDict kept with a double linked list of the > items? There's a doubly-linked list containing the values. Another dictionary maps keys to the list. -- http://mail.python.

Re: C API: how to replace python number object in place?

2009-05-14 Thread Benjamin Peterson
Stephen Vavasis cpu111.math.uwaterloo.ca> writes: > > If x is a C variable of type PyObject*, and I happen to know already that > the object is of a numeric type, say int, is there a way to change the > value of x in place to a different number? In the C/API documentation I > found routines

Re: scoping problem with list comprehension // learning Python

2009-05-20 Thread Benjamin Peterson
Adrian Dragulescu eskimo.com> writes: > > > I just started to learn python (first posting to the list). > > I have a list of dates as strings that I want to convert to a > list of datetime objects. Here is my debugging session from inside a > method. > > (Pdb) formatIndex > '%Y-%m-%d' > (

Re: How can I get access to the function called as a property?

2009-05-24 Thread Benjamin Peterson
Matthew Wilson tplus1.com> writes: > > I use a @property decorator to turn some methods on a class into > properties. I want to be able to access some of the attributes of the > original funtion, but I don't know how to get to it. my_class.__dict__["some_property].(fget|fdel|fset) -- http:

Re: FILE object in Python3.0 extension modules

2009-05-29 Thread Benjamin Peterson
Joachim Dahl gmail.com> writes: > > How do I perform type checking for such an object in the extension > module, > and how do I extract a FILE * object from it? I browsed the C API > documentation, but > couldn't find an answer. You use PyObject_IsInstance to test if the object is an instance

Re: FILE object in Python3.0 extension modules

2009-05-29 Thread Benjamin Peterson
Gabriel Genellina yahoo.com.ar> writes: > But you have to import the io module first, don't you? That's not usually > necesary for most built in types -- e.g. PyFloat_Check just checks for a > float object. Well, in 3.x, file is not longer a builtin type. -- http://mail.python.org/mailma

[RELEASED] Python 3.1 Release Candidate 1

2009-05-30 Thread Benjamin Peterson
nload/releases/3.1/ See PEP 375 for release schedule details: http://www.python.org/dev/peps/pep-0375/ Enjoy, -- Benjamin Benjamin Peterson benjamin at python.org Release Manager (on behalf of the entire python-dev team and 3.1's contributors) -- http://mail.python.org/mailman/listi

Re: how to free memory allocated by a function call via ctypes

2009-05-30 Thread Benjamin Peterson
Tzury Bar Yochay gmail.com> writes: > > My question is how do I free the memory allocated when I call this > function using ctypes The return type of ctypes.create_string_buffer() will call free() when it is garbage collected. -- http://mail.python.org/mailman/listinfo/python-list

Re: how to find the last decorator of a chain

2009-05-30 Thread Benjamin Peterson
Gabriel opensuse.org> writes: > In my understanding this equivalent to: > > render('a', > render('b', > view(***))) > > Is there any way to know, in this case, that 'a' is the 'default' format? You could set an attribute on the function indicating the default. -- http://mail.python.or

Re: Safe to import __builtin__ ?

2009-06-03 Thread Benjamin Peterson
mrstevegross gmail.com> writes: > > Is it generally safe to explicitly import __builtin__ in python? That > is, my code reads like this: ... > > It seems like it should be a safe import, but I just want to make > sure. Yes, that's fine. I'm not sure why you don't just use type(), though. -

Re: Missing codecs in Python 3.0

2009-06-03 Thread Benjamin Peterson
samwyse gmail.com> writes: > > I have a Python 2.6 program (a code generator, actually) that tries > several methods of compressing a string and chooses the most compact. > It then writes out something like this: > { encoding='bz2_codec', data = '...'} In 3.x, all codecs which don't directly

Re: Python3 - encoding issues

2009-11-28 Thread Benjamin Peterson
DreiJane h-labahn.de> writes: > Does anybody want to make a PEP from this (i won't do so) ? I will answer this query with a little interactive prompt session: $ python3 Python 3.1.1 (r311:74480, Nov 14 2009, 13:56:40) [GCC 4.3.4] on linux2 Type "help", "copyright", "credits" or "license" for mor

Re: Python3 - encoding issues

2009-11-28 Thread Benjamin Peterson
DreiJane h-labahn.de> writes: > > Ohhh - that's nice. But no words of that in the library reference > here: > > http://docs.python.org/3.1/library/stdtypes.html#sequence-types-str-bytes-bytearray-list-tuple-range That's because it's here: http://docs.python.org/3.1/library/stdtypes.html#bytes-

[RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
e 2.7 documentation can be found at: http://docs.python.org/2.7 Please consider trying Python 2.7 with your code and reporting any bugs you may notice to: http://bugs.python.org Have fun! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and

Re: [RELEASED] Python 2.7 alpha 1

2009-12-05 Thread Benjamin Peterson
My apologies. The whatsnew link is actually http://docs.python.org/dev/whatsnew/2.7. 2009/12/5 Benjamin Peterson : > On behalf of the Python development team, I'm pleased to announce the first > alpha release of Python 2.7. -- Regards, Benjamin -- http://mail.python.org/mailm

Re: C to Python

2009-12-10 Thread Benjamin Peterson
Emeka gmail.com> writes: > > > Hello All, >   > I am finding it difficult getting my head around PyObject_CallObject(x,y). I need a gentle and thorough introduction to it. I also need examples. Could someone come to my need? PyObject_CallFunction is probably easier to use. http://docs.python.o

Re: lib2to3 pattern creation with unexpected results

2009-12-22 Thread Benjamin Peterson
Zac Burns gmail.com> writes: > > > Greetings,I'm trying to re-purpose the lib2to3 module and along the way came up with this pattern:"funcdef<'def' name=NAME parameters ['->' test] ':' suite=suite>"It seems to have 2 problems: > > Single-line defs are not matched. Eg: "def singleLineFunc(): re

Re: lib2to3 pattern creation with unexpected results

2009-12-22 Thread Benjamin Peterson
Zac Burns gmail.com> writes: > I'm trying to match any function block, the two examples were just a part of my unit tests.   I know. I was just giving an example to indicate why it doesn't work. find_pattern.py is useful because it gives you a base from which it's easy to extrapolate the genera

Re: PyCFunction_New(): to Py_DECREF() or not to Py_DECREF()

2009-12-26 Thread Benjamin Peterson
Ecir Hana gmail.com> writes: > do I have to > > Py_DECREF(function) > > or not? Yes, you still own the reference to the function. -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 2.7 alpha 2

2010-01-09 Thread Benjamin Peterson
ation can be found at: http://docs.python.org/2.7 Please consider trying Python 2.7 with your code and reporting any bugs you may notice to: http://bugs.python.org Have fun! -- Benjamin Peterson 2.7 Release Manager benjamin at python.org (on behalf of the entire python-dev team and

Re: Syntax question

2009-10-10 Thread Benjamin Peterson
Helmut Jarausch skynet.be> writes: > > Hi, > > I'm trying to build the recent Python-3.2a (SVN). > It fails in > Lib/tokenize.py (line 87) How are you invoking it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Syntax question

2009-10-10 Thread Benjamin Peterson
Helmut Jarausch skynet.be> writes: > As I said, it's 'make' in Python's source directory > (SVN revision 75309 Last Changed Date: 2009-10-10) I can't reproduce your failure. What are the exact commands you are using? -- http://mail.python.org/mailman/listinfo/python-list

Re: No module named os

2009-10-10 Thread Benjamin Peterson
home.com> writes: > I'm trying to build a small program and I get the above error. > I have had this error popup in the past while trying to build other > programs. What can I do? You're python is apparently not finding the standard library. -- http://mail.python.org/mailman/listinfo/python

Re: code in a module is executed twice (cyclic import problems) ?

2009-10-10 Thread Benjamin Peterson
Stef Mientki gmail.com> writes: > Why is the B.py executed twice ? Because it's executed once as a script and once as a module. -- http://mail.python.org/mailman/listinfo/python-list

Re: restriction on sum: intentional bug?

2009-10-16 Thread Benjamin Peterson
MRAB mrabarnett.plus.com> writes: > It checks to see whether you're trying to sum strings, so it's already > treating them as a special case. Why can't it just use str.join > internally instead in that case instead of raising an exception? Because that violates explicit is better than implicit.

Re: restriction on sum: intentional bug?

2009-10-16 Thread Benjamin Peterson
Alan G Isaac gmail.com> writes: > So of course join is better, as originally noted, > but that does not constitute a reason to intentionally > violate duck typing. As Stephen pointed out, duck typing is not an absolute. -- http://mail.python.org/mailman/listinfo/python-list

Re: '11' + '1' is '111'?

2009-10-29 Thread Benjamin Peterson
metal gmail.com> writes: > > '11' + '1' == '111' is well known. > > but it suprises me '11'+'1' IS '111'. > > Why? Obviously they are two differnt object. > > Is this special feature of imutable object? As other posters have pointed out, CPython does cache some small strings. In this case, h

Re: 2to3 ParseError with UTF-8 BOM

2009-11-05 Thread Benjamin Peterson
Farshid gmail.com> writes: > If I remove the BOM then it works fine. Is this expected behavior or a > bug in the 2to3 script? Try the 2to3 distributed in Python 3.1. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C api: create a new object class

2009-11-10 Thread Benjamin Peterson
lallous lgwm.org> writes: > Is there is a one line syntax to instantiate an instance? You can't instantiate an instance; it's already instantiated. > > Any other ways than this: > o = new.classobj('object', (), {}) class x: pass > How can I, similarly, create an object "o" in C api: Use PyOb

Re: Threaded import hang in cPickle.dumps

2009-11-10 Thread Benjamin Peterson
Zac Burns gmail.com> writes: > What can I do about this? Not run it in a thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: pointless musings on performance

2009-11-24 Thread Benjamin Peterson
Tim Wintle teamrubber.com> writes: > Out of interest - has anyone else spotted that the call to > PyObject_IsTrue in the XXX_JUMP_IF_ blocks performs two unnecessary > pointer comparisons? I doubt two pointer comparisons will make much of a difference. > Would it be worth in-lining the remai

Re: iglob performance no better than glob

2010-01-31 Thread Benjamin Peterson
Kyp stsci.edu> writes: > So the iglob was faster, but accessing the first file took about the > same time as glob.glob. That would be because glob is implemented in terms of iglob. -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3147 - new .pyc format

2010-01-31 Thread Benjamin Peterson
Sean DiZazzo gmail.com> writes: > Does "magic" really need to be used? Why not just use the revision > number? Because magic is easier and otherwise CPython developers would have to rebuild their pycs everytime their working copy was updated. -- http://mail.python.org/mailman/listinfo/python-

[RELEASED] Python 2.7 alpha 3

2010-02-06 Thread Benjamin Peterson
.7 Please consider trying Python 2.7 with your code and reporting any bugs you may notice to: http://bugs.python.org Enjoy! -- Benjamin Peterson 2.7 Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7's contributors) -- http://mail.python.org/mailman/

Re: TABS in the CPython C source code

2010-02-06 Thread Benjamin Peterson
Neil Hodgson gmail.com> writes: >This would damage the usefulness of source control histories (svn > annotate) as all of the converted lines would show this recent cosmetic > change rather than the previous change which is likely to be a > substantive modification. That's not completely true

Re: TABS in the CPython C source code

2010-02-06 Thread Benjamin Peterson
Alf P. Steinbach start.no> writes: > Anyways, I would suggest converting all those tabs to spaces This has been discussed to death of Python-dev. We use spaces for all new files and tabs for historical reasons in old files. Mixed ones should be converted one way or the other. > > That's much m

[RELEASED] Python 3.1.2 release candidate

2010-03-06 Thread Benjamin Peterson
st of changes in 3.1.2rc1 can be found here: http://svn.python.org/projects/python/tags/r312rc1/Misc/NEWS The 3.1 documentation can be found at: http://docs.python.org/3.1 Bugs can always be reported to: http://bugs.python.org Enjoy! -- Benjamin Peterson Release Manager benjam

[RELEASED] Python 2.7 alpha 4

2010-03-06 Thread Benjamin Peterson
.7 Please consider trying Python 2.7 with your code and reporting any bugs you may notice to: http://bugs.python.org Enjoy! -- Benjamin Peterson 2.7 Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7's contributors) -- http://mail.python.org/m

[RELEASED] Python 3.1.2

2010-03-21 Thread Benjamin Peterson
list of changes in 3.1.2 can be found here: http://svn.python.org/projects/python/tags/r312/Misc/NEWS The 3.1 documentation can be found at: http://docs.python.org/3.1 Bugs can always be reported to: http://bugs.python.org Enjoy! -- Benjamin Peterson Release Manager benjam

[RELEASED] Python 2.7.1

2010-11-27 Thread Benjamin Peterson
n can be found at: http://docs.python.org/2.7/ This is a production release. Please report any bugs you find to the bug tracker: http://bugs.python.org/ Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7.1's co

[RELEASED] Python 3.1.3

2010-11-27 Thread Benjamin Peterson
n.org/download/releases/3.1.3/ A list of changes in 3.1.3 can be found here: http://svn.python.org/projects/python/tags/r313/Misc/NEWS The 3.1 documentation can be found at: http://docs.python.org/3.1 Bugs can always be reported to: http://bugs.python.org Enjoy! -- Benjamin Pet

[RELEASED] 2.7 beta 1

2010-04-10 Thread Benjamin Peterson
ion can be found at: http://docs.python.org/2.7 Please consider trying Python 2.7 with your code and reporting any bugs you may notice to: http://bugs.python.org Enjoy! -- Benjamin Peterson 2.7 Release Manager benjamin at python.org (on behalf of the entire python-dev team

Re: Destructor being called twice?

2010-04-12 Thread Benjamin Peterson
Longpoke gmail.com> writes: > So either this test case is wrong to assume the destructor can only be > called once, or there is a bug in Python? Destructors can be called more than once in CPython, but other implementations have proper finalization behavior. -- http://mail.python.org/mailman

Re: Oddity with large dictionary (several million entries)

2010-04-27 Thread Benjamin Peterson
Lothar Werzinger tradescape.biz> writes: > Wow, that really MAKES a difference! Thanks a lot! You should also try Python 2.7 or 3.1. We've recently optimized the garabage collector for situations where many objects are being created. -- http://mail.python.org/mailman/listinfo/python-list

Re: List comprehension + lambdas - strange behaviour

2010-05-06 Thread Benjamin Peterson
Artur Siekielski gmail.com> writes: > > Of course I was expecting the list [0, 1, 2, 3, 4] as the result. The > 'x' was bound to the final value of 'range(5)' expression for ALL > defined functions. Can you explain this? Is this only counterintuitive > example or an error in CPython? The former.

[RELEASED] Python 2.7 beta 2

2010-05-08 Thread Benjamin Peterson
lease and is thus not suitable for production use, we encourage Python application and library developers to test the release with their code and report any bugs they encounter to: http://bugs.python.org/ 2.7 documentation can be found at: http://docs.python.org/2.7/ Enjoy! -- Ben

Re: compile() error

2010-05-19 Thread Benjamin Peterson
Iuri gmail.com> writes: > Any ideas about what is happening? Until Python 2.7/3.2, compile() does't like sources which don't end in a newline. -- http://mail.python.org/mailman/listinfo/python-list

Re: Need some Python 3 help

2010-05-25 Thread Benjamin Peterson
Paul McGuire austin.rr.com> writes: > In this section of code, instring is a string, loc is an int, and wt > is a string. Any clues why instring[loc] would be evaluating as int? > (I am unfortunately dependent on the kindness of strangers when it > comes to testing my Python 3 code, as I don't ha

[RELEASE] Python 2.7 release candidate 1 released

2010-06-05 Thread Benjamin Peterson
s few bumps as possible. 2.7 documentation can be found at: http://docs.python.org/2.7/ Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: GUIs - A Modest Proposal

2010-06-05 Thread Benjamin Peterson
ant uklinux.net> writes: > PyQt is tied to one platform. What do you mean one platform? -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 2.7 release candidate 2

2010-06-21 Thread Benjamin Peterson
helps ensure that those upgrading to Python 2.7 will encounter as few bumps as possible. 2.7 documentation can be found at: http://docs.python.org/2.7/ Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7's contributors

Re: deprecated string module issue

2010-06-24 Thread Benjamin Peterson
GrayShark gmail.com> writes: > Sorry, I meant "from string import lowercase, uppercase" Technically, you should use ascii_lowercase and ascii_uppercase, though I don't know if that's the cause of pylint's complaints. -- http://mail.python.org/mailman/listinfo/python-list

[RELEASE] Python 2.7 released

2010-07-04 Thread Benjamin Peterson
http://bugs.python.org/ Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 2.7's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 2.7 released

2010-07-04 Thread Benjamin Peterson
2010/7/4 Benjamin Peterson : > On behalf of the Python development team, I'm jocund to announce the second > release candidate of Python 2.7. Arg!!! This should, of course, be "final release". -- Regards, Benjamin -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.2 alpha 1

2010-08-01 Thread Benjamin Peterson
Hey, Georg! Congrats on your first release! 2010/8/1 Georg Brandl : > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team, I'm happy to announce the > first alpha preview release of Python 3.2. > > Python 3.2 is a continuation of the efforts to improve and

Re: bug? context managers vs ImportErrors

2010-08-19 Thread Benjamin Peterson
Chris Withers simplistix.co.uk> writes: > When was it introduced? It depends on how the exception was raised. -- http://mail.python.org/mailman/listinfo/python-list

Re: #! to two different pythons?

2009-06-06 Thread Benjamin Peterson
pixar.com> writes: > What's the best way to handle this? #!/usr/bin/env python -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.1 Release Candidate 2

2009-06-13 Thread Benjamin Peterson
n.org/download/releases/3.1/ See PEP 375 for release schedule details: http://www.python.org/dev/peps/pep-0375/ Enjoy, -- Benjamin Benjamin Peterson benjamin at python.org Release Manager (on behalf of the entire python-dev team and 3.1's contributors) -- http://mail.python.org/mailma

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha gmail.com> writes: > > Hey gentlemen, > > I wanna make all the strings in my code unicode strings. How to do it > without giving unicode switch 'u' before every string? Or the -U flag, but that's probably a bad idea. -- http://mail.python.org/mailman/listinfo/python-list

Re: to use unicode strings only

2009-06-27 Thread Benjamin Peterson
Gaudha gmail.com> writes: > And Peter, I tried importing the __future__ module. It's also not > working... How so? -- http://mail.python.org/mailman/listinfo/python-list

[RELEASED] Python 3.1 final

2009-06-27 Thread Benjamin Peterson
Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 3.1's contributors) -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.1 final

2009-06-28 Thread Benjamin Peterson
Nobody nowhere.com> writes: > All in all, Python 3.x still has a long way to go before it will be > suitable for real-world use. Such as? -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.1 final

2009-06-28 Thread Benjamin Peterson
Nobody nowhere.com> writes: > > Such as not trying to shoe-horn every byte string it encounters into > Unicode. Some of them really are *just* byte strings. You're certainly allowed to convert them back to byte strings if you want. -- http://mail.python.org/mailman/listinfo/python-list

Re: [RELEASED] Python 3.1 final

2009-06-28 Thread Benjamin Peterson
Paul Moore gmail.com> writes: > The "buffer" attribute doesn't seem to be documented in the docs for > the io module. I'm guessing that the TextIOBase class should have a > note that you get at the buffer through the "buffer" attribute? Good point. I've now documented it, and the "raw" attribut

Re: [RELEASED] Python 3.1 final

2009-06-28 Thread Benjamin Peterson
Aahz pythoncraft.com> writes: > Yes, but do you get back the original byte strings? Maybe I'm missing > something, but my impression is that this is still an issue for the email > module as well as command-line arguments and environment variables. The email module is, yes, broken. You can recove

Re: [RELEASED] Python 3.1 final

2009-06-28 Thread Benjamin Peterson
Nobody nowhere.com> writes: > > On Sun, 28 Jun 2009 19:21:49 +, Benjamin Peterson wrote: > > >> Yes, but do you get back the original byte strings? Maybe I'm missing > >> something, but my impression is that this is still an issue for the email

Re: why PyObject_VAR_HEAD?

2009-06-29 Thread Benjamin Peterson
kio gmail.com> writes: > > Hi, > > I'm studying the CPython source code. I don’t quite understand why > they’re using PyObject_VAR_HEAD to define struct like PyListObject. To > define such kind of struct, could I use _PyObject_HEAD_EXTRA as a > header and add "items" pointer and "allocated" cou

Re: python+encryption

2009-06-30 Thread Benjamin Peterson
jayshree gmail.com> writes: > > I have the key pair generated by the GPG. Now I want to use the public > key for encrypting the password. I need to make a function in Python. > Can somebody guide me on how to do this … PyCrypto -- http://mail.python.org/mailman/listinfo/python-list

Re: getting rid of —

2009-07-01 Thread Benjamin Peterson
someone googlemail.com> writes: > > Hello, > > how can I replace '—' sign from string? Or do split at that character? > Getting unicode error if I try to do it: > > UnicodeDecodeError: 'ascii' codec can't decode byte 0x97 in position > 1: ordinal not in range(128) Please paste your code. I s

Re: What are the limitations of cStringIO.StringIO() ?

2009-07-02 Thread Benjamin Peterson
ryles gmail.com> writes: > > This reminds me. Would anyone object to adding a sentence to > http://docs.python.org/library/stringio.html#module-cStringIO just to > mention that attributes cannot be added to a cStringIO, like such: That's true of almost all types that are implemented in C. -

[RELEASED] Python 3.1.1 Release Candidate

2009-08-13 Thread Benjamin Peterson
http://www.python.org/download/releases/3.1/ The 3.1 documentation can be found at: http://docs.python.org/3.1 Bugs can always be reported to: http://bugs.python.org Enjoy! -- Benjamin Peterson Release Manager benjamin at python.org (on behalf of the entire python-dev team and 3.

[RELEASED] Python 3.1.1

2009-08-16 Thread Benjamin Peterson
oming days. To download Python 3.1.1 visit: http://www.python.org/download/releases/3.1.1/ The 3.1 documentation can be found at: http://docs.python.org/3.1 Bugs can always be reported to: http://bugs.python.org Enjoy! -- Benjamin Peterson Release Manager benjamin at pytho

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Simon Forman gmail.com> writes: > No. You would have to modify and recompile the interpreter. This is > not exactly trivial, see "How to Change Python's Grammar" > http://www.python.org/dev/peps/pep-0306/ And even that's incorrect. You'd have to modify the tokenizer. -- http://mail.python.o

Re: Annoying octal notation

2009-08-21 Thread Benjamin Peterson
Derek Martin pizzashack.org> writes: > More than flushing out > bugs, it will *cause* them in ubiquity, requiring likely terabytes of > code to be poured over and fixed. 2to3, however, can fix it for you extreme easily. -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >