[Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-09 Thread Terry Reedy
A commit (push) partition time and behavior into before and after (with a short change period in between during which behavior is undefined). Some commit messages have the form 'x does y'. Does 'does' mean before or after? Sometimes that is clear. 'x crashes' means before. 'x return correct va

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-09 Thread Terry Reedy
On 5/9/2011 4:05 PM, Guido van Rossum wrote: On Mon, May 9, 2011 at 12:36 PM, Eric Smith wrote: On 05/09/2011 03:17 PM, Guido van Rossum wrote: While my own preference is "make X properly raise an exception" I'm happy with any of the alternatives proposed here, and grateful to Terry for call

Re: [Python-Dev] Commit changelog: issue number and merges

2011-05-09 Thread Terry Reedy
On 5/9/2011 1:54 PM, R. David Murray wrote: If I do 'hg log' and search for a revno (that I got from hg annotate), the commit message describing the change is not attached to that revno, nor as far as I know is there a tool that makes it easy to get from that revno to the explanatory commit mess

Re: [Python-Dev] more timely detection of unbound locals

2011-05-10 Thread Terry Reedy
On 5/10/2011 10:59 AM, Nick Coghlan wrote: On Tue, May 10, 2011 at 11:11 PM, R. David Murray wrote: How about: "reference to variable 'y' precedes an assignment that makes it a local variable" For comparison, the error messages I was able to elicit from 2.7 were as follows: # Module level N

Re: [Python-Dev] Commit messages: please avoid temporal ambiguity

2011-05-11 Thread Terry Reedy
On 5/11/2011 12:39 PM, Éric Araujo wrote: Funny, I always use the present tense, to convey what the code does now. Which code ;-). At the moment you write a push message, your private clone does something different from the public repository (and other private clones). At the moment people

Re: [Python-Dev] [Python-checkins] cpython (2.7): (Merge 3.1) Issue #12012: ssl.PROTOCOL_SSLv2 becomes optional

2011-05-11 Thread Terry Reedy
On 5/11/2011 2:08 PM, Victor Stinner wrote: Le mercredi 11 mai 2011 à 19:05 +0200, Éric Araujo a écrit : Le 10/05/2011 01:52, victor.stinner a écrit : http://hg.python.org/cpython/rev/3c87a13980be changeset: 70001:3c87a13980be branch: 2.7 parent: 69996:c9f07c69b138 user:Vict

Re: [Python-Dev] Python 3.x and bytes

2011-05-18 Thread Terry Reedy
On 5/18/2011 4:10 PM, Ethan Furman wrote: Ethan Furman wrote: [...] Also posted to Python-Ideas. Good. That is where it should have gone in the first place, as this is about ideas not yet even in the PEP stage. -- Terry Jan Reedy ___ Python-Dev

Re: [Python-Dev] Equality testing

2011-05-18 Thread Terry Reedy
On 5/18/2011 2:51 PM, Ethan Furman wrote: In Python 3 inequality comparisons became forbidden. --> 123 < [1, 2, 3] Traceback (most recent call last): File "", line 1, in TypeError: unorderable types: int() < list() However, equality comparisons are still allowed --> 123 == [1, 2, 3] False Bu

Re: [Python-Dev] Don't set local variable in a list comprehension or generator

2011-05-18 Thread Terry Reedy
On 5/18/2011 10:19 AM, Nadeem Vawda wrote: I'm not sure why you would encounter code like that in the first place. Surely any code of the form: ''.join(c for c in my_string) would just return my_string? Or am I missing something? Good question. Anything useful like "'-'.join(c for c in

Re: [Python-Dev] Don't set local variable in a list comprehension or generator

2011-05-18 Thread Terry Reedy
On 5/18/2011 5:34 PM, Victor Stinner wrote: You initial example gave me the impression that the issue has something to do with join in particular, or even comprehensions in particular. It is really about for loops. squares = (x*x for x in range(1)) >>> dis('for x in range(3): y = x

Re: [Python-Dev] Don't set local variable in a list comprehension or generator

2011-05-18 Thread Terry Reedy
On 5/18/2011 5:37 PM, Amaury Forgeot d'Arc wrote: Hi, 2011/5/18 Terry Reedy: On 5/18/2011 10:19 AM, Nadeem Vawda wrote: I'm not sure why you would encounter code like that in the first place. Surely any code of the form: ''.join(c for c in my_string) would just ret

Re: [Python-Dev] Inconsistent case in directory names for installed Python on Windows

2011-05-18 Thread Terry Reedy
On 5/18/2011 10:33 PM, anatoly techtonik wrote: ├[Python27] │ ├─DLLs │ ├─Doc │ ├─include │ ├─Lib │ ├─libs │ ├─Scripts │ ├─tcl │ └─Tools Except for DLLs and tcl, these are the platform-independent names in the source tree. They are copied directly over to the installations, and I would not wa

Re: [Python-Dev] [RELEASED] Python 3.2.1 rc 1

2011-05-18 Thread Terry Reedy
On 5/18/2011 10:46 PM, anatoly techtonik wrote: On Wed, May 18, 2011 at 10:37 PM, Georg Brandl wrote: On 18.05.2011 21:09, "Martin v. Löwis" wrote: http://hg.python.org/releasing/3.2.1/ To clarify: once the final is done, the repo Martin mentioned will be merged back to main and then vani

Re: [Python-Dev] Python 3.x and bytes

2011-05-19 Thread Terry Reedy
On 5/19/2011 3:49 AM, Nick Coghlan wrote: It's a mental model problem. People try to think of bytes as equivalent to 2.x str and that's just wrong, wrong, wrong. It's far closer to array.array('c'). Or like C char arrays Strings are basically *unique* in returning a length 1 instance of them

Re: [Python-Dev] Python 3.x and bytes

2011-05-23 Thread Terry Reedy
On 5/23/2011 1:20 PM, Ethan Furman wrote: Glyph Lefkowitz wrote: In fact, I feel like I would want to push in the opposite direction: don't treat one-byte bytes slices less like integers; I wish I could more easily treat n-byte sequences _more_ like integers! :). More protocols have 2-byte or 4-

Re: [Python-Dev] CPython optimization: storing reference counters outside of objects

2011-05-24 Thread Terry Reedy
On 5/24/2011 8:25 AM, Sturla Molden wrote: Artur Siekielski is not talking about cache locality, but copy-on-write fork on Linux et al. When reference counts are updated after forking, memory pages marked copy-on-write are copied if they store reference counts. And then he quickly runs out of m

Re: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader

2011-05-24 Thread Terry Reedy
On 5/24/2011 6:14 AM, M.-A. Lemburg wrote: I have no idea why TextIOWrapper was added to the stdlib instead of making StreamReaderWriter more capable, since StreamReaderWriter had already been available in Python since Python 1.6 (and this is being used by codecs.open()). As I understand it, y

Re: [Python-Dev] Stable buildbots update

2011-05-24 Thread Terry Reedy
On 5/24/2011 6:27 AM, Nick Coghlan wrote: On Tue, May 24, 2011 at 7:56 PM, Antoine Pitrou wrote: Thank you very much! What a beautiful sight this is: http://www.python.org/dev/buildbot/all/waterfall?category=3.x.stable (until a sporadic failure comes up, that is) I could turn test_crashers b

Re: [Python-Dev] [Python-checkins] cpython: Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl

2011-05-24 Thread Terry Reedy
On 5/24/2011 12:06 PM, Victor Stinner wrote: Le mardi 24 mai 2011 à 11:27 -0400, Terry Reedy a écrit : +.. function:: RAND_bytes(num) + + Returns *num* cryptographically strong pseudo-random bytes. + + .. versionadded:: 3.3 + +.. function:: RAND_pseudo_bytes(num) + + Returns (bytes

Re: [Python-Dev] [pyodbc] Setting values to SQL_* constants while creating a connection object

2011-05-24 Thread Terry Reedy
On 5/24/2011 5:09 PM, srinivasan munisamy wrote: Hi, I would like to know how to set values to values to SQL_* constants Please direct Python use questions to python-listor other user discussion forums. Py-dev is for discussion of development of the next versions of Python. -- Terry Jan Ree

Re: [Python-Dev] [Python-checkins] cpython: Issue #12049: Add RAND_bytes() and RAND_pseudo_bytes() functions to the ssl

2011-05-25 Thread Terry Reedy
On 5/25/2011 1:09 AM, Nick Coghlan wrote: The more important feature here is that it is exposing *OpenSSL's* random number generation, rather than our own. I agree, thought from a different stance, I think. The issue is whether we should 'automatically' expose everything is a wrapped library,

Re: [Python-Dev] [Python-checkins] cpython: Avoid useless "++" at the end of functions

2011-05-26 Thread Terry Reedy
On 5/26/2011 10:34 AM, Ronald Oussoren wrote: On 26 May, 2011, at 16:10, Eric Smith wrote: and make silent the Clang Static Analyzer :-) I care less about that than maintainability and future-proofing. Have to looked at the patch? The patch and resulting code look sane to me, and if a

Re: [Python-Dev] cpython: Avoid useless "++" at the end of functions

2011-05-26 Thread Terry Reedy
On 5/26/2011 2:08 PM, Guido van Rossum wrote: Sorry to butt in here, but I agree with Eric that it was better before. There is a common idiom, *pointer++ =, and whenever you see that you know that you are appending something to an output buffer. Perhaps the most important idea here is that this

Re: [Python-Dev] Deprecate codecs.open() and StreamWriter/StreamReader

2011-05-27 Thread Terry Reedy
On 5/27/2011 11:08 AM, Victor Stinner wrote: Tell me if I am wrong, but only Marc-Andre is against deprecating StreamReader While I am, in general, in favor of removing some duplication, I was and am against doing this change precipitously. So I was for the reversion (noted), at least tempor

Re: [Python-Dev] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread Terry Reedy
On 5/31/2011 1:04 PM, anatoly techtonik wrote: Hi, I'd like to escalate http://bugs.python.org/issue12226 : 'use secured channel for uploading packages to pypi' to be shipped with next Python 2.6+ This will prevent pydotorg password sniffing when submitting packages through public networks (such

Re: [Python-Dev] Sniffing passwords from PyPI using insecure connection

2011-05-31 Thread Terry Reedy
On 6/1/2011 1:37 AM, "Martin v. Löwis" wrote: The requested one character change is -DEFAULT_REPOSITORY = 'http://pypi.python.org/pypi' +DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi' If Tarek (or perhaps Eric) agree that it is appropriate and otherwise innocuous, then Martin and Ba

Re: [Python-Dev] [Python-checkins] cpython (2.7): Multiple clean-ups to the docs for builtin functions.

2011-06-01 Thread Terry Reedy
On 6/1/2011 6:50 PM, raymond.hettinger wrote: - with open("mydata.txt") as fp: - for line in iter(fp.readline, "STOP"): > process_line(line) As noted on the tracker, this will always loop forever. Even if "STOP" is corrected to "STOP\n", it will still loop forever

Re: [Python-Dev] cpython: Remove some extraneous parentheses and swap the comparison order to

2011-06-07 Thread Terry Reedy
On 6/7/2011 5:35 PM, David Malcolm wrote: I know that this style is unpopular, but if it helps, try mentally pronouncing "==" in C as "is the value of". In this example, when I read that line, my mind is thinking: "if 'u' is the value of typecode" After ~12 years of doing this, it come

Re: [Python-Dev] fatal error callback issue

2011-06-08 Thread Terry Reedy
On 6/8/2011 3:30 PM, Tom Whittock wrote: I'm writing in regards to http://bugs.python.org/issue1195571 I'm embedding Python in my application and ran into a need for this functionality. I wrote a similar patch myself, and was about to submit it. When I searched for similar issues I found that th

Re: [Python-Dev] PEP 3101 implementation vs. documentation

2011-06-11 Thread Terry Reedy
On 6/11/2011 6:32 AM, Petri Lehtinen wrote: Nick Coghlan wrote: [snip] It seems to me that the intent of the pep and the current doc is that field_names should match what one would write in code except that quotes are left off of literal string keys. Which is to say, the brackets [] serve as

Re: [Python-Dev] [RELEASE] Python 2.7.2

2011-06-12 Thread Terry Reedy
On 6/12/2011 1:57 PM, Benjamin Peterson wrote: To download Python 2.7.2 visit: http://www.python.org/download/releases/2.7.1/ That should be http://www.python.org/download/releases/2.7.2/ -- Terry Jan Reedy ___ Python-Dev mailing list Python-

Re: [Python-Dev] Lazy unpacking for struct module

2011-06-12 Thread Terry Reedy
On 6/12/2011 11:29 AM, Lukas Lueg wrote: This sort of speculative idea might fit the python-ideas list better. [Summary: we often need to extract a field or two from a binary record in order to decide whether to toss it or unpack it all and process.] One solution to this is using two format-

Re: [Python-Dev] EuroPython Language Summit report

2011-06-24 Thread Terry Reedy
On 6/24/2011 7:18 AM, Victor Stinner wrote: Le vendredi 24 juin 2011 à 10:52 +0200, Mark Dickinson a écrit : One example: when opening a text file for reading and writing, the default encoding used depends on the platform and on various environment variables. ... oh, I agree. This cho

Re: [Python-Dev] ctypes: Configurable bitfield allocation strategy

2011-06-25 Thread Terry Reedy
On 6/25/2011 12:33 PM, Vlad Riscutia wrote: I recently started looking at some ctypes issues. I dug a bit into http://bugs.python.org/issue6069 and then I found http://bugs.python.org/issue11920. They both boil down to the fact that bitfield allocation is up to the compiler, which is different in

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-26 Thread Terry Reedy
On 6/26/2011 2:52 PM, Senthil Kumaran wrote: http://bugs.python.org/issue10403 is a documentation bug which talks about using the term 'attribute' instead of the term 'member' when it denotes the class attributes. Agreed. But the discussion goes on to mention that, "Members and methods" should

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-27 Thread Terry Reedy
On 6/27/2011 4:24 AM, Antoine Pitrou wrote: Le Mon, 27 Jun 2011 11:32:32 +1000, Nick Coghlan a écrit : "Members" is a historical relic that is best replaced by "attributes" or "data attributes" if we want to explicitly exclude methods for some reason. "Methods" is a subset of attributes that

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-27 Thread Terry Reedy
On 6/27/2011 5:42 AM, Michael Foord wrote: On 27/06/2011 09:24, Antoine Pitrou wrote: FWIW, I tend to understand "members" as "methods + attributes", which makes it a nice term to use for that purpose. That is my understanding / use of the terms as well. On 6/27/2011 5:45 AM, Oleg Broytman

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-27 Thread Terry Reedy
On 6/27/2011 2:33 PM, Terry Reedy wrote: Let me repeat that that is historically wrong for Python, and illustrate why the term 'members' should not be used. From the 1.5 Language Reference, 3.2 Standard type hierarchy: "There are also some 'generic' special attrib

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 9:43 AM, Victor Stinner wrote: In Python 2, open() opens the file in binary mode (e.g. file.readline() returns a byte string). codecs.open() opens the file in binary mode by default, you have to specify an encoding name to open it in text mode. In Python 3, open() opens the file in

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 10:02 AM, M.-A. Lemburg wrote: How about a more radical change: have open() in Py3 default to opening the file in binary mode, if no encoding is given (even if the mode doesn't include 'b') ? That'll make it compatible to the Py2 world again I disagree. I believe S = open('myfile

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 10:06 AM, Antoine Pitrou wrote: On Tue, 28 Jun 2011 15:43:05 +0200 Victor Stinner wrote: - ISO-8859-1 os some FreeBSD systems - ANSI code page on Windows, e.g. cp1252 (close to ISO-8859-1) in Western Europe, cp952 in Japan, ... - ASCII if the locale is manually set to an empt

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-28 Thread Terry Reedy
On 6/28/2011 7:51 AM, R. David Murray wrote: Also, instances can have methods as instance attributes. Functions that are instance attributes do not act like methods (instance.func() does not automagically turn instance in the first arg of func) and have never, to my knowledge, been called me

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-28 Thread Terry Reedy
On 6/28/2011 9:20 AM, Steven D'Aprano wrote: >>> class C: ... def method(self, x): ... return x+1 ... >>> c = C() >>> c.method = types.MethodType(lambda self, x: x+101, c) types.MethodType creates a bound method, not a method. A bound method is a partial or curried function, which is to sa

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 10:48 AM, Michael Foord wrote: On 28/06/2011 15:36, Terry Reedy wrote: S = open('myfile.txt').read() now return a text string in both Py2 and Py3 and a subsequent 'abc' in S works in both. Nope, it returns a bytestring in Python 2. Which, in Py2 is a s

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 10:46 AM, Paul Moore wrote: I use Windows, and come from the UK, so 99% of my text files are ASCII. So the majority of my code will be unaffected. But in the occasional situation where I use a £ sign, I'll get encoding errors, I do not understand this. With utf-8 you would never g

Re: [Python-Dev] Issue10403 - using 'attributes' instead of members in documentation

2011-06-28 Thread Terry Reedy
On 6/28/2011 11:35 AM, Michael Foord wrote: On 28/06/2011 16:23, Terry Reedy wrote: So-called 'staticmethods' are not really methods either, but are class function attributes that are just functions and not treated as methods. The decorator that negates normal method treatment co

Re: [Python-Dev] open(): set the default encoding to 'utf-8' in Python 3.3?

2011-06-28 Thread Terry Reedy
On 6/28/2011 5:42 PM, Georg Brandl wrote: At the very least, a change like this needs a transitional strategy, like it has been used during the 2.x series: * In 3.3, accept "locale" as the encoding parameter, meaning the locale encoding * In 3.4, warn if encoding isn't given and the locale enco

Re: [Python-Dev] Draft PEP: Deprecate codecs.StreamReader and codecs.StreamWriter

2011-07-07 Thread Terry Reedy
On 7/7/2011 7:28 AM, Antoine Pitrou wrote: The main point of the PEP, IMO, is actually the deprecation itself. By deprecating, we signal that something isn't actively maintained anymore, and that a (allegedly better) alternative is available. I think that's a very reasonable thing to do, regardl

Re: [Python-Dev] 3.2.1 encoding surprise

2011-07-18 Thread Terry Reedy
On 7/18/2011 3:10 PM, Glenn Linderman wrote: Attached reduced test case works fine with Python 3.1, fails with Python3.2: SyntaxError: Non-ASCII character '\xc3' in file D:\my\py\t32enc.py on line 1, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details It runs fin

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-19 Thread Terry Reedy
On 7/19/2011 12:21 PM, Paul Moore wrote: On 19 July 2011 16:16, Antoine Pitrou wrote: On Tue, 19 Jul 2011 16:00:57 +0100 Perhaps this could be changed? As far as I can see, python.exe is a small executable around ~25KB (all the code being in the DLL), so there doesn't seem to be any harm to

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-20 Thread Terry Reedy
On 7/20/2011 3:22 AM, Paul Moore wrote: On 20 July 2011 03:21, Terry Reedy wrote: Suppose for Windows there were one '.../python' directory wherever the user first asks it to be put and that all pythons, not just cpython, are installed in directories below that and that the small st

Re: [Python-Dev] New tests in stable versions

2011-07-20 Thread Terry Reedy
On 7/20/2011 12:25 PM, Victor Stinner wrote: Le 20/07/2011 17:58, Éric Araujo a écrit : Do we have a policy of not adding new test files to stable branches? New logging tests failed during some weeks. If we add new tests, we may also break some stable buildbots. I don't think that we need to ad

Re: [Python-Dev] [Python-checkins] cpython: #665194: support roundtripping RFC2822 date stamps in the email.utils module

2011-07-20 Thread Terry Reedy
On 7/20/2011 11:41 AM, r.david.murray wrote: diff --git a/Lib/email/utils.py b/Lib/email/utils.py # We need wormarounds for bugs in these methods in older Pythons (see below) Is 'wormaround' (variation of workaround) an intentional play on the fact that some worms prey on other 'bugs' ;-

Re: [Python-Dev] Draft PEP: "Simplified Package Layout and Partitioning"

2011-07-20 Thread Terry Reedy
On 7/20/2011 1:04 PM, P.J. Eby wrote: This part worries me slightly. Imagine a program as such: datagen.py json/foo.js json/bar.js datagen.py uses the files in json/ to generate sample data for a database. In datagen.py is the following code: try: import json except ImportError: import simple

Re: [Python-Dev] Issue10271 - warnings.showwarning should allow any callable object - request commiter

2011-07-21 Thread Terry Reedy
On 7/21/2011 2:15 PM, Brett Cannon wrote: It won't break any _existing_ code, but it could cause compatibility for _future_ code. Imagine I wrote some code for 3.2.2 where this change was backported and worked *only* with this fix. That would mean my code would fail in any Python 3.2.1 or older

Re: [Python-Dev] New tests in stable versions

2011-07-21 Thread Terry Reedy
On 7/21/2011 2:58 AM, Raymond Hettinger wrote: I concur with Brett. Nothing good will come from backporting tests that aren't aimed at a specific bugfix. They could catch reversions that otherwise would not be caught. This would mainly apply to 2.7. It would not be an issue for 3.2 if all fix

Re: [Python-Dev] Python launcher command line usage (Was: 3.2.1 encoding surprise)

2011-07-21 Thread Terry Reedy
On 7/20/2011 7:55 PM, Mark Hammond wrote: On 21/07/2011 4:38 AM, Terry Reedy wrote: Many installers first make an organization directory and then an app directory within that. This annoys me sometimes when they only have one app to ever install, but is useful when there might really be

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-27 Thread Terry Reedy
On 7/27/2011 9:24 AM, Antoine Pitrou wrote: On Wed, 27 Jul 2011 16:14:40 +0300 Eli Bendersky wrote: Will it take long for newbie code to appear with the test.support version? Not to mention that grepping code that imports the "unlink" function directly doesn't reveal which one is being used.

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-27 Thread Terry Reedy
On 7/27/2011 10:27 AM, Eli Bendersky wrote: Initially I was *for* documenting, but this thing with showing up in the index is a compelling counter-point. "The basic version makes entries in the general index; if no index entry is desired, you can give the directive option flag

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-27 Thread Terry Reedy
On 7/27/2011 9:24 AM, Antoine Pitrou wrote: Docstrings are sufficient for own our purposes. >>> import test.support as t >>> help(t.rmtree) Help on function rmtree in module test.support: rmtree(path) ;-) -- Terry Jan Reedy ___ Python-Dev mailing

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-27 Thread Terry Reedy
On 7/27/2011 1:27 PM, Brett Cannon wrote: Perhaps what we could do is move the documentation for test.support to the devguide, and then vet the test suite so that unlink and friends are always called as 'support.unlink', etc. I like this solution since this issue of documenting tes

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-27 Thread Terry Reedy
On 7/27/2011 1:57 PM, Eli Bendersky wrote: Out of curiosity, why would a user need to run Python's tests? If one compiles Python, running the tests is essential. Some people like to run a test suite to verify an installation. Sometimes people have problems that might arise from an installation

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-29 Thread Terry Reedy
On 7/29/2011 11:18 AM, Barry Warsaw wrote: I'd much rather solve this problem by adding markup to functions that explicitly disclaim our normal backward compatibility guarantees. I suggested adding a footnote marker (1) to each one. test.support *is* part of the stdlib. So once again, is

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-29 Thread Terry Reedy
On 7/29/2011 11:25 AM, Antoine Pitrou wrote: t We have lots of internal APIs which are not documented, though. They are generally used only within the module itself as helper functions. So one only needs to even know about them when looking at the module code. And test.support *is* for int

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-29 Thread Terry Reedy
On 7/29/2011 5:32 PM, Antoine Pitrou wrote: On Fri, 29 Jul 2011 11:51:18 -0400 Barry Warsaw wrote: On Jul 29, 2011, at 05:25 PM, Antoine Pitrou wrote: test.support *is* part of the stdlib. We have lots of internal APIs which are not documented, though. And test.support *is* for internal use

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-30 Thread Terry Reedy
On 7/29/2011 6:54 PM, Antoine Pitrou wrote: On Fri, 29 Jul 2011 18:47:07 -0400 Terry Reedy wrote: And test.support *is* for internal use. No, the stuff in there is *not* for internal use within the module but for external use is possiby every test module. I meant internal use for us

Re: [Python-Dev] Convention on functions that shadow existing stdlib functions

2011-07-30 Thread Terry Reedy
On 7/29/2011 7:27 PM, Antoine Pitrou wrote: On Fri, 29 Jul 2011 19:02:32 -0400 Terry Reedy wrote: On 7/29/2011 5:32 PM, Antoine Pitrou wrote: On Fri, 29 Jul 2011 11:51:18 -0400 Barry Warsaw wrote: The solution then is to rename test.support to test._support to make it clear it'

Re: [Python-Dev] The docs, reloaded

2007-05-20 Thread Terry Reedy
Please add a link to the PEP index (which is also missing from docs.python.org, though not from python.org/doc/. And consider at least some PEPs as part of the corpus indexed (ie, those with info not in the regular docs). tjr ___ Python-Dev mailing

Re: [Python-Dev] Build problems with sqlite on OSX

2007-05-25 Thread Terry Reedy
"Darrin Thompson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | First of all 1000 apologies if this is the wrong list. Please redirect | me if necessary. Usage questions should usually be directed first to comp.lang.python / gmane.comp.python.general / python-list (all 3 are int

Re: [Python-Dev] error in Misc/NEWS

2007-06-01 Thread Terry Reedy
"Raghuram Devarakonda" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | There is an entry in "Core and builtins" section of Misc/NEWS: | | "Bug #1722484: remove docstrings again when running with -OO.". | | The actual bug is 1722485. Incidentally, 1722484 appears to be spam. Sure en

Re: [Python-Dev] IDLE Functionality

2007-07-05 Thread Terry Reedy
"Oodi Pilzer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi, I am trying to duplicate the indenting functionality of the IDLE into another environment used in an educational setting at MIT. As Python is open software, I assume I can look at the source code for the IDLE. If s

Re: [Python-Dev] Typo in itertools.dropwhile()

2007-07-12 Thread Terry Reedy
"Stephen J. Turnbull" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Raymond Hettinger writes: | | > [Matthieu on itertools.dropwhile() docs] | | > > Note, the iterator does not produce any output until the | > > predicate is true | | > it did return EVERY element from the first fa

Re: [Python-Dev] Three-char file extensions

2007-07-15 Thread Terry Reedy
For me, .pyz is fine. Python has more or less a trademark on .pyx extensions, and one more fits well. I think we should stick with them. Confusion of .pyz with .py.z is not an issue with Windows users, though I can understand how it might be for *nix users. On the other hand, pyzip is quite

Re: [Python-Dev] NotImplemented comparisons

2007-08-02 Thread Terry Reedy
"Facundo Batista" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | >>> class C(object): | ... def __cmp__(self, other): | ... return NotImplemented | ... Given that you 'should' return an int, doing elsewise has undefined results. | >>> c = C() | >>> print c < None I

Re: [Python-Dev] Compiler Python

2007-09-11 Thread Terry Reedy
"Carlos Martínez" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Someone knows since as I can obtain the information detailed about the | compiler of Python? (Table of tokens, lists of productions of the syntactic | one , semantic restrictions...) Ask this sort of question on the

Re: [Python-Dev] Adding concat function to itertools

2007-09-28 Thread Terry Reedy
"Bruce Frederiksen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] A 64K attachment. Please do not do such a worse-than-useless thing again. Especially when only 1K is original. ___ Python-Dev mailing list Python-Dev@python.org http://

Re: [Python-Dev] [python] Re: New lines, carriage returns, and Windows

2007-09-29 Thread Terry Reedy
"Michael Foord" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Guido van Rossum wrote: [snip first part of nice summary of Python i/o model] | > The other translation deals with line endings. Upon input, any of | > \r\n, \r, or \n is translated to a single \n by default (this is

Re: [Python-Dev] [python] Re: New lines, carriage returns, and Windows

2007-09-29 Thread Terry Reedy
"Michael Foord" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Terry Reedy wrote: | > There are two normal ways for internal Python text to have \r\n: | > 1. Read from a file with \r\r\n. Then \r\r\n is correct output (on the | > same platform). | > 2

Re: [Python-Dev] [python] Re: New lines, carriage returns, and Windows

2007-10-01 Thread Terry Reedy
"Nick Maclaren" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The question is independent of what the outside system believes a | text file should look like, and is solely what Python believes a | sequence of characters should mean. For example, does 'A\r\nB' | mean that B is sep

Re: [Python-Dev] Python 2.5.1 ported to z/OS and EBCDIC

2007-10-22 Thread Terry Reedy
"Lauri Alanko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | All this just shows that treating plain octet sequences as "strings" | simply won't work in the long run. You have to have separate type for | _textual_ data (i.e. Unicode strings, in Python), and encode and decode | bet

Re: [Python-Dev] Declaring setters with getters

2007-10-31 Thread Terry Reedy
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> I'm not sure about the name "propset" ... | >Maybe something like "setproperty" would be better. | | I think not. Saying "setproperty" has too many ambiguous mental parsings. When does "set" take place -- assig

Re: [Python-Dev] Special file "nul" in Windows and os.stat

2007-11-06 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> If yes, we have three paths to follow... leave 2.5 as is and say that | > the behaviour change is ok (windows fault), change 2.5 to use the same | > API than 2.4 and get the same behaviour, or hardwire the behaviou

Re: [Python-Dev] for loop with if filter

2007-11-16 Thread Terry Reedy
"Gustavo Carneiro" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |I am finding myself often doing for loops over a subset of a list, like: | |for r in results: |if r.numNodes != numNodes: |continue |# do something with r Why write it

Re: [Python-Dev] Should we do away with unbound methods in Py3k?

2007-11-21 Thread Terry Reedy
If I understand correctly, this would negate the need for staticmethod() when accessing the function via the class (and not instances) since the main effect of that is to prevent the wrapping. (And since I consider instance.somestaticmeth() as even less idiomatic Python that class.somestaticme

Re: [Python-Dev] Should we do away with unbound methods in Py3k?

2007-11-22 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |Do we need a PEP? In my view, no. And I am a fan of PEPs. I personally saw unbound method wrapping as more of a CPython implementation detail than an essential part of the language definition. This in spite of i

Re: [Python-Dev] Should we do away with unbound methods in Py3k?

2007-11-24 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Also, there was discussion of this before: | http://mail.python.org/pipermail/python-dev/2005-January/050625.html | -- why didn't we decide to do it then? 1. Nobody ran with it. 2. There was mild concern with breaki

Re: [Python-Dev] [poll] New name for __builtins__

2007-11-28 Thread Terry Reedy
"Christian Heimes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || | What name do you prefer? I'm +1 with Raymond on __root__ but I'm still | open for better suggestions. Ok with me, or __rootnames__, but __root_namespace__ is too long for me ;-) __

Re: [Python-Dev] removing the new and types modules

2007-11-29 Thread Terry Reedy
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | [EMAIL PROTECTED] wrote: | > Sorry if this is a dumb question, but are there actually good reasons to remove "types"? | | Mainly because it is an unrelated grab bag of types that could be put in | more topical locations

Re: [Python-Dev] [poll] New name for __builtins__

2007-11-29 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | But then I thought, what if we renamed the __builtin__ module instead | to builtins, and left __builtins__ alone? | | In Python 0.1, __builtin__ *was* called builtin, and I think the | reason for renaming it wasn't p

Re: [Python-Dev] [poll] New name for __builtins__

2007-11-30 Thread Terry Reedy
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I think the situation with __main__ is different from __builtin__, I effectively agreed by not disputing Guido's response ;-) ___ Python-Dev mailing list Python-Dev@python.o

Re: [Python-Dev] Non-string keys in namespace dicts

2007-12-01 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | On Dec 1, 2007 7:09 PM, Neil Toronto <[EMAIL PROTECTED]> wrote: | > Are there any use-cases for allowing namespace dicts (such as globals, | > builtins and classes) to have non-string keys? I'm asking because I'm | >

Re: [Python-Dev] PEP Idea: Syntactic sugar for StopIteration.

2007-12-08 Thread Terry Reedy
I would prefer plain 'yield' to 'yield break' as a synonym for 'raise StopIteration'. But the raise stands out better visually as an exit point. The point about the raise not being explicitly caught is not valid since any generator could be used in the following code g = some_gen try: while

Re: [Python-Dev] What to do for bytes in 2.6?

2008-01-17 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Is it reading text or binary data from stream blah? We can't tell. If | it's meant to be reading text, 2to3 should leave it alone. But if it's | meant to be reading binary data, 2to3 should change the string | liter

Re: [Python-Dev] Simple syntax proposal: "not is"

2008-01-25 Thread Terry Reedy
"Jameson "Chema" Quinn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I'm writing a source code editor that translates identifiers and keywords | on-screen into a different natural language. This tool will do no | transformations except at the reversible word level. There is one s

Re: [Python-Dev] trunc()

2008-01-25 Thread Terry Reedy
"Guido van Rossum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Does no-one thinks it means round(f) either? Not me. Int should truncate, so trunc() not needed unless is does something different. And I would prefer the float-input-only converters be in math. There is nothi

Re: [Python-Dev] [python] trunc()

2008-01-25 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] |> If the ambiguity is that 'int' behaviour is unspecified for floats - is | > it naive to suggest we specify the behaviour? | | The concern is that whatever gets specified is arbitrary. There are many | ways how an i

Re: [Python-Dev] trunc()

2008-01-26 Thread Terry Reedy
"Jeffrey Yasskin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || To elaborate the point I was trying to make: If float() does not mean | "the float part of" The 'float part' of a complex number is meaningless since both components of a complex are floats (in practice, or reals i

Re: [Python-Dev] Organization of ABC modules

2008-01-26 Thread Terry Reedy
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Raymond Hettinger wrote: | > A prefix would be better. | | I initially thought that, but found the suffix to be the least annoying | of the ideas I had for denoting abstract base classes. To try and give || INumber || AB

Re: [Python-Dev] trunc()

2008-01-27 Thread Terry Reedy
"Michael Urman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 2) The semantics of int() are fuzzy; even non-numeric types | (strings) are handled One could just as well say that the semantics of float() are fuzzy since it also handles strings. The actual claim seems to have b

Re: [Python-Dev] Different float formatting on Windows and Linux

2008-02-18 Thread Terry Reedy
"Eric Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | The tests for float.__format__ are breaking on Windows, because of this | issue: http://bugs.python.org/issue1600. Basically, Windows is using 3 | digits for exponents < 100, and Linux (and at least MacOS) are using 2. |

<    13   14   15   16   17   18   19   20   21   22   >