Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Neal Norwitz
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > > I have usually seen a lot of tests implemented like this: > > from test.test_support import TESTFN, unlink > import unittest > > class TestCase(unittest.TestCase): > > def setUp(self): > self.file = No

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Neal Norwitz
On Thu, Feb 21, 2008 at 2:26 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > I'm going to work on backporting PEP 3127, specifically the hex, oct(), > and bin() builtins. I have bin() completed, and I'll check it in > shortly. oct() will require a future import. Does anyone have any > pointers fo

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
Raymond Hettinger wrote: > [Eric Smith] >> Speaking for myself, these features are generally useful, >> and are so even without the new integer literal syntax. > > I'm curious how these are useful to you in Py2.6 where > they are not invertible. In Py3.0, we can count on > > x == int(bin(x), 2

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Raymond Hettinger
[Eric Smith] > Speaking for myself, these features are generally useful, > and are so even without the new integer literal syntax. I'm curious how these are useful to you in Py2.6 where they are not invertible. In Py3.0, we can count on x == int(bin(x), 2) x == eval(bin(x)) I don't see how

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
Raymond Hettinger wrote: > [Eric Smith] >> I'm going to work on backporting PEP 3127, specifically >> the hex, oct(), and bin() builtins. > > IMO, these should not be backported. They are strongly > associated with 3.0's new literal syntax. They don't > don't really fit in with 2.6 and don't mak

Re: [Python-Dev] dir() and __all__

2008-02-21 Thread Raymond Hettinger
[Benjamin] > Are you proposing just a list those modules > or all module objects? The idea is dead. Guido specified that the dir() function returns a list of names for which hasattr() will succeed. I only brought this up because a colleague was using dir() on modules to find-out about the API

Re: [Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

2008-02-21 Thread Skip Montanaro
Why not just skip the specifics except to say < 80 characters for all lines? Don't mention 72, 79 or any other number than 80: Maximum Line Length There are still many devices around that are limited to 80 character lines; plus, limiting windows to 80 characters makes it po

Re: [Python-Dev] int/float freelists vs pymalloc

2008-02-21 Thread Vladimir Marangozov
May I chime in? :-) Gents, the current implementation of Python's memory management is really fine and most problems it used to have in the past have been fixed in recent years (at least the ones I know of). Probably the only one left, indeed, is the potential unbounded growth of int/float objec

Re: [Python-Dev] trunk-math

2008-02-21 Thread Christian Heimes
Nick Coghlan wrote: > I would put the context manager in the math module as well. contextlib > is intended for generic context related tools (like nested() and > closing() that don't have a more topical home. I'll reimplement the ieee754 context manager in C once the feature gets accepted. For the

Re: [Python-Dev] dir() and __all__

2008-02-21 Thread Benjamin
On Feb 15, 9:18 pm, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > [Raymond] > > >> Should dir(module) use __all__ when defined? > > [GvR] > > > It's not consistent with what dir() of a class or instance does though. > > > -1. > > Perhaps there is another solution. Have dir() exclude objects >

Re: [Python-Dev] Backporting PEP 3101 to 2.6

2008-02-21 Thread Eric Smith
André Malo wrote: > * Eric Smith wrote: >> But now that I look at time.strftime in py3k, it's converting the entire >> unicode string to a char string with PyUnicode_AsString, then converting >> back with PyUnicode_Decode. > > Looks wrong to me, too... :-) > > nd I don't understand Unicode encod

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Raymond Hettinger
[Eric Smith] > I'm going to work on backporting PEP 3127, specifically >the hex, oct(), and bin() builtins. IMO, these should not be backported. They are strongly associated with 3.0's new literal syntax. They don't don't really fit in with 2.6 and don't make 2.6 any more attractive. Raymond _

Re: [Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Guido van Rossum
I wonder if, in order to change the behavior of various built-in functions, it wouldn't be easier to be able to write from future_builtins import oct, hex # and who knows what else Agreed with your approach for bin(). On Thu, Feb 21, 2008 at 2:26 PM, Eric Smith <[EMAIL PROTECTED]> wrote: > I'm

[Python-Dev] Backporting PEP 3127 to trunk

2008-02-21 Thread Eric Smith
I'm going to work on backporting PEP 3127, specifically the hex, oct(), and bin() builtins. I have bin() completed, and I'll check it in shortly. oct() will require a future import. Does anyone have any pointers for implementing this? I understand (and have completed) adding the future impo

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Jonathan Lange
On Fri, Feb 22, 2008 at 2:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Brett Cannon
On Thu, Feb 21, 2008 at 8:06 AM, Facundo Batista <[EMAIL PROTECTED]> wrote: > 2008/2/21, Gregory P. Smith <[EMAIL PROTECTED]>: > > > > > That sounds eminently sensible. So sensible there should be > > > documentation that tells us to do that. Drat it, where's Brett Cannon > > > when you need him

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Brett Cannon
On Thu, Feb 21, 2008 at 7:50 AM, Steve Holden <[EMAIL PROTECTED]> wrote: > Guido van Rossum wrote: > > On Wed, Feb 20, 2008 at 11:59 PM, Virgil Dupras <[EMAIL PROTECTED]> wrote: > >> On 2/21/08, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> > - no selection -118 > >> > wont fix

Re: [Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

2008-02-21 Thread Brett Cannon
On Thu, Feb 21, 2008 at 9:15 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > On Feb 21, 2008, at 11:21 AM, skip.montanaro wrote: > > > Author: skip.montanaro > > Date: Thu Feb 21 17:21:15 2008 > > New Revision: 60919 > > > > Modified: >

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Brett Cannon
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Martin v. Löwis
> This is the result for the "open" status issues? I guess not, because > the rejected, fixed, etc, should be closed. > > Could you run this again, please, but filtering by "open" tickets? Here you go - no selection -381 wont fix2 works for me0 accepted4 fixed 2 dup

Re: [Python-Dev] Nosy lists on issue tracker.

2008-02-21 Thread Georg Brandl
Martin v. Löwis schrieb: >> What is the policy regarding nosy lists? Is it appropriate it add people >> to it besides oneself? As I cannot assign items, I'm sometimes tempted >> to add someone relevant to the list. (ie Should I add Georg to >> documentation related issues?) > > I would find it

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Martin v. Löwis
> Everything in this aspect would be simpler if we have one word for > what I just meant. If you think it should be fixed, please submit a report in the meta tracker, ideally specifying precisely how you want to see it changed. It's possible to "retire" objects in Roundup: certain resolution valu

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Martin v. Löwis
> What would be the difference between accepted and fixed for a closed ticket? As Guido says: a bug gets fixed, a patch gets accepted. This was copied over from SF, but it makes sense to me and everybody seems to be following it. Regards, Martin ___ P

Re: [Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

2008-02-21 Thread Ron Adam
Barry Warsaw wrote: > Why should docstrings and comments be limited to 72 characters when > code is limited to 79 characters? I ask because there is an ongoing > debate at my company about this. I'm not sure if this is the main reason, but when using pydoc to view docstrings, the 72 chara

Re: [Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

2008-02-21 Thread Guido van Rossum
On Thu, Feb 21, 2008 at 9:15 AM, Barry Warsaw <[EMAIL PROTECTED]> wrote: > Why should docstrings and comments be limited to 72 characters when > code is limited to 79 characters? I ask because there is an ongoing > debate at my company about this. People in your company have too much time on t

Re: [Python-Dev] [Python-checkins] r60919 - peps/trunk/pep-0008.txt

2008-02-21 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Feb 21, 2008, at 11:21 AM, skip.montanaro wrote: > Author: skip.montanaro > Date: Thu Feb 21 17:21:15 2008 > New Revision: 60919 > > Modified: > peps/trunk/pep-0008.txt > Log: > Replace "looks ugly" with a hopefully more concrete explanation of

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Christian Heimes
Guido van Rossum wrote: >> I don't think so. >> You could create a directory in setUp method by using tempfile.mkdtemp >> and then remove it in tearDown. > > Specifically, clean it up with shutil.rmtree() And make sure you have closed all files before you rmtree() the directory. Otherwise the

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
On 2/21/08, Nick Coghlan <[EMAIL PROTECTED]> wrote: > Virgil Dupras wrote: > > On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: > >> Hi devs, > >> > >> Being a python dev newbie, I look in http://www.python.org/dev/ for > >> some guide to write unit tests in python and I can't find any.

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Facundo Batista
2008/2/21, Gregory P. Smith <[EMAIL PROTECTED]>: > > That sounds eminently sensible. So sensible there should be > > documentation that tells us to do that. Drat it, where's Brett Cannon > > when you need him? :-) > > I'm always faced with a tiny quandry when closing a fixed bug that had a > patch

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Gregory P. Smith
On 2/21/08, Steve Holden <[EMAIL PROTECTED]> wrote: > > Guido van Rossum wrote: > > On Wed, Feb 20, 2008 at 11:59 PM, Virgil Dupras <[EMAIL PROTECTED]> > wrote: > > >> What would be the difference between accepted and fixed for a closed > ticket? > > > > I don't know what others do, but I use acce

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Facundo Batista
2008/2/21, Virgil Dupras <[EMAIL PROTECTED]>: > I don't see why would want to run this query on open tickets. What > would it tell you? How many old issue there is? You can already know > that with a simple search. The goal of this script is to know the > resolution of tickets that had a 6+ mon

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Nick Coghlan
Virgil Dupras wrote: > On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: >> Hi devs, >> >> Being a python dev newbie, I look in http://www.python.org/dev/ for >> some guide to write unit tests in python and I can't find any. >> Specifically, I'd like to know about files managements in tests.

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Virgil Dupras
On 2/21/08, Facundo Batista <[EMAIL PROTECTED]> wrote: > This is the result for the "open" status issues? I guess not, because > the rejected, fixed, etc, should be closed. > > Could you run this again, please, but filtering by "open" tickets? I don't see why would want to run this query on open

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Steve Holden
Guido van Rossum wrote: > On Wed, Feb 20, 2008 at 11:59 PM, Virgil Dupras <[EMAIL PROTECTED]> wrote: >> On 2/21/08, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> > - no selection -118 >> > wont fix189 >> > works for me62 >> > accepted310 >> > fixed 611 >>

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Facundo Batista
2008/2/20, "Martin v. Löwis" <[EMAIL PROTECTED]>: > - no selection -118 > wont fix189 > works for me62 > accepted310 > fixed 611 > duplicate 75 > later 17 > invalid 73 > postponed 6 > out of date 193 > remind 1 > rejected180 Thi

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread A.M. Kuchling
On Thu, Feb 21, 2008 at 08:59:51AM +0100, Virgil Dupras wrote: > Thanks for running it. The rate is better than I expected, so I was > wrong in my assumption. > > What would be the difference between accepted and fixed for a closed ticket? 'accepted' is probably used more for patches, while 'fixe

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Guido van Rossum
On Thu, Feb 21, 2008 at 7:43 AM, Giampaolo Rodola' <[EMAIL PROTECTED]> wrote: > On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > > Hi devs, > > > > > > Specifically, I'd like to know about files managements in tests. Is > > every test expected to clean after itself, or is there an

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Giampaolo Rodola'
On 21 Feb, 12:30, "Virgil Dupras" <[EMAIL PROTECTED]> wrote: > Hi devs, > > Specifically, I'd like to know about files managements in tests. Is > every test expected to clean after itself, or is there an automatic > cleanup mechanism in place? I have usually seen a lot of tests implemented like t

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Guido van Rossum
On Wed, Feb 20, 2008 at 11:59 PM, Virgil Dupras <[EMAIL PROTECTED]> wrote: > On 2/21/08, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > - no selection -118 > > wont fix189 > > works for me62 > > accepted310 > > fixed 611 > > duplicate 75 > > later

Re: [Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
On 2/21/08, Virgil Dupras <[EMAIL PROTECTED]> wrote: > Hi devs, > > Being a python dev newbie, I look in http://www.python.org/dev/ for > some guide to write unit tests in python and I can't find any. > Specifically, I'd like to know about files managements in tests. Is > every test expected to

[Python-Dev] Unit Test Guide

2008-02-21 Thread Virgil Dupras
Hi devs, Being a python dev newbie, I look in http://www.python.org/dev/ for some guide to write unit tests in python and I can't find any. Specifically, I'd like to know about files managements in tests. Is every test expected to clean after itself, or is there an automatic cleanup mechanism in p

Re: [Python-Dev] Small RFEs and the Bug Tracker

2008-02-21 Thread Virgil Dupras
On 2/21/08, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > - no selection -118 > wont fix189 > works for me62 > accepted310 > fixed 611 > duplicate 75 > later 17 > invalid 73 > postponed 6 > out of date 193 > remind 1 > rejected18