Re: [Python-Dev] Removing IDLE from the standard library

2010-07-13 Thread Giampaolo Rodolà
One of the main problems with IDLE is the lack of tabs for editing multiple files within the same window. Having that alone would be a great improvement. --- Giampaolo http://code.google.com/p/pyftpdlib http://code.google.com/p/psutil ___ Python-Dev mail

Re: [Python-Dev] Issue 2986: difflib.SequenceMatcher is partly broken

2010-07-13 Thread Terry Reedy
Summary: adding an autojunk heuristic to difflib without also adding a way to turn it off was a bug because it disabled running code. 2.6 and 3.1 each have, most likely, one final version each. Don't fix for these but add something to the docs explaining the problem and future fix. 2.7 will

Re: [Python-Dev] notifications form Hg to python-checkins

2010-07-13 Thread Nick Coghlan
On Wed, Jul 14, 2010 at 7:45 AM, Dirkjan Ochtman wrote: > On Tue, Jul 13, 2010 at 23:22, Nick Coghlan wrote: >> No, I meant push. There's a separate discussion where it was pointed >> out that publishing each commit as a separate email makes >> python-checkins even chattier than it is already (th

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Nick Coghlan
On Wed, Jul 14, 2010 at 7:34 AM, Fred Drake wrote: > On Tue, Jul 13, 2010 at 5:02 PM, Nick Coghlan wrote: >> Fred's point about the practice of changing __name__ in the main >> module corrupting generated pickles is one I hadn't thought of before >> though. > > Not sure about changing __name__ an

Re: [Python-Dev] notifications form Hg to python-checkins

2010-07-13 Thread Dirkjan Ochtman
On Tue, Jul 13, 2010 at 23:22, Nick Coghlan wrote: > No, I meant push. There's a separate discussion where it was pointed > out that publishing each commit as a separate email makes > python-checkins even chattier than it is already (this point came up > after Tarek pushed a distutils2 changeset c

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Glyph Lefkowitz
On Jul 13, 2010, at 5:02 PM, Nick Coghlan wrote: > My concerns aren't about a module reimporting itself directly, they're > about the case where a utility module is invoked as __main__ but is > also imported normally somewhere else in a program (e.g. pdb is > invoked as a top-level debugger, but i

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Fred Drake
On Tue, Jul 13, 2010 at 5:02 PM, Nick Coghlan wrote: > Fred's point about the practice of changing __name__ in the main > module corrupting generated pickles is one I hadn't thought of before > though. Not sure about changing __name__ anywhere... I don't do that. When an "application" is defined

Re: [Python-Dev] notifications form Hg to python-checkins

2010-07-13 Thread Nick Coghlan
On Wed, Jul 14, 2010 at 5:56 AM, Éric Araujo wrote: >> I was actually going to suggest something along those lines post >> transition, since Hg will have an email address for everyone - leave >> push notifications coming from the bot (so existing filters based on >> the bot address keep working),

Re: [Python-Dev] Issue 2986: difflib.SequenceMatcher is partly broken

2010-07-13 Thread Tim Peters
[Tim] >> ... >> BTW, it's not clear whether ratio() computes a _useful_ value in the >> presence of junk, however that may be defined. [Terry Reedy] > I agree, which is one reason why one should be to disable auto-junking. Yup. > There are a number of statistical methods for analyzing similarity

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Alexander Belopolsky
On Tue, Jul 13, 2010 at 4:52 PM, Brett Cannon wrote: .. > Pulling from sys.modules is the correct way to do this. There are subtle > issues when using a bunk fromlist argument (empty modules, double > initialization, etc.). If one does not use importlib.import_module -- > written *specifically* to

Re: [Python-Dev] [Idle-dev] Removing IDLE from the standard library; Scherer Agreement

2010-07-13 Thread Pat Campbell
Hi Bruce: Please click on the link below to find the contributor agreement form along with instructions on how to send it. http://www.python.org/psf/contrib/ If you have any questions, please let me know. Thanks, Pat Campbell PSF Secretary & Administrator On Mon, Jul 12, 2010 at 9:34 PM, Kurt

Re: [Python-Dev] How to block a module import

2010-07-13 Thread Nick Coghlan
> Nick's right; 0 fails on an import * to pull anything in of interest. And as > I said on python-checkins -- you can ignore that email, Alexander -- there > is a historical reason because in Python 2 if you tried an implicit relative > import a value of None met to do an absolute import. This does

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Nick Coghlan
On Wed, Jul 14, 2010 at 2:25 AM, Michael Foord wrote: > Sure - there are trivial workarounds which is why I don't think there are > *many* genuine use cases for a module reimporting itself with a different > name. My concerns aren't about a module reimporting itself directly, they're about the ca

Re: [Python-Dev] How to block a module import

2010-07-13 Thread Alexander Belopolsky
On Tue, Jul 13, 2010 at 4:34 PM, Brett Cannon wrote: .. > Nick's right; 0 fails on an import * to pull anything in of interest. but if the imported module has try: import blocked_module except ImportError: do_something_important() then import_fresh_module() will create a broken module wit

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Brett Cannon
On Tue, Jul 13, 2010 at 11:34, Alexander Belopolsky < alexander.belopol...@gmail.com> wrote: > On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson > wrote: > .. > > No! That's not recommended and a complete hack. The "dance" or > > importlib.import_module is preferred. > > Nevertheless, "a complet

Re: [Python-Dev] python-checkins

2010-07-13 Thread Dirkjan Ochtman
This is getting a little off-topic, but let me just respond to this... On Tue, Jul 13, 2010 at 22:10, Barry Warsaw wrote: > Does Mercurial have a similar feature?  If so, I would suggest that we enable > that and require committers to use registered gpg keys to sign their commits. > We'd always h

Re: [Python-Dev] How to block a module import

2010-07-13 Thread Brett Cannon
On Tue, Jul 13, 2010 at 05:48, Nick Coghlan wrote: > On Tue, Jul 13, 2010 at 10:37 AM, Alexander Belopolsky > wrote: > > In my experiments, 0 is not equivalent to None: > > > import sys, time > sys.modules['time'] = 0 > __import__('time') > > 0 > sys.modules['time'] = None >

Re: [Python-Dev] python-checkins replies

2010-07-13 Thread Brett Cannon
On Mon, Jul 12, 2010 at 16:42, Michael Foord wrote: > On 12/07/2010 23:48, Eric Smith wrote: > >> On 7/12/2010 6:04 PM, Michael Foord wrote: >> >>> Given how high traffic python-checkins is I don't consider that a >>> reasonable place to send follow-up and nor do I consider it the >>> responsibili

Re: [Python-Dev] python-checkins

2010-07-13 Thread Barry Warsaw
On Jul 13, 2010, at 09:56 PM, Éric Araujo wrote: >Note that nothing in Mercurial forces you to have a parsable >“Name ” user name, it’s just a good practice. Dirkjan’s mapping >uses a dummy to...@python.org address for unknown IDs, which probably >means the other tools he’s writing depend on an em

Re: [Python-Dev] python-checkins

2010-07-13 Thread Éric Araujo
> I was actually going to suggest something along those lines post > transition, since Hg will have an email address for everyone - leave > push notifications coming from the bot (so existing filters based on > the bot address keep working), but include the push author in the > reply-to field. IIR

Re: [Python-Dev] Include datetime.py in stdlib or not?

2010-07-13 Thread Alexander Belopolsky
On Thu, Jul 8, 2010 at 3:09 PM, Brett Cannon wrote: .. > I can say that all the VM representatives have all said they like the idea. This is encouraging. Here is an update on the status of datetime.py. I believe it is mostly ready to move from sandbox to py3k/Lib. The patch is available on the

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Alexander Belopolsky
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson wrote: .. > No! That's not recommended and a complete hack. The "dance" or > importlib.import_module is preferred. Nevertheless, "a complete hack" is what PyImport_Import does: PyObject * PyImport_Import(PyObject *module_name) { static PyObj

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Jack Diederich
On Tue, Jul 13, 2010 at 1:57 PM, Benjamin Peterson wrote: > 2010/7/13 Alexander Belopolsky : >> On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote: >>> On Tue, 13 Jul 2010 11:25:23 -0400 >> .. >>> Only for top-level modules: >>> >> __import__("distutils.core", level=0) >>> >> '/home/antoi

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Benjamin Peterson
2010/7/13 Alexander Belopolsky : > On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote: >> On Tue, 13 Jul 2010 11:25:23 -0400 > .. >> Only for top-level modules: >> > __import__("distutils.core", level=0) >> > '/home/antoine/py3k/__svn__/Lib/distutils/__init__.py'> > sys.modules["distut

Re: [Python-Dev] Removing IDLE from the standard library

2010-07-13 Thread John Nagle
On Sun, Jul 11, 2010 at 18:20, Tal Einat wrote: > > The (hopefully) compelling arguments were others, such as the sentence > > following the one you quoted: > > > > "I think that in its current state, IDLE may still be helpful for > > learning Python, but it is more likely to drive away users who

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Michael Foord
On 13/07/2010 14:00, Nick Coghlan wrote: (Two different classes with the same name created - one from __main__ and one from real_name.) Use cases for *genuinely* reimporting the same module with different names (as different module objects rather than aliases) are relatively rare, and the problem

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Michael Foord
On 13/07/2010 16:46, Alexander Belopolsky wrote: On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote: On Tue, 13 Jul 2010 11:25:23 -0400 .. Only for top-level modules: __import__("distutils.core", level=0) sys.modules["distutils.core"]

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Alexander Belopolsky
On Tue, Jul 13, 2010 at 11:34 AM, Antoine Pitrou wrote: > On Tue, 13 Jul 2010 11:25:23 -0400 .. > Only for top-level modules: > __import__("distutils.core", level=0) > '/home/antoine/py3k/__svn__/Lib/distutils/__init__.py'> sys.modules["distutils.core"] > '/home/antoine/py3k/__svn__/Li

Re: [Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Antoine Pitrou
On Tue, 13 Jul 2010 11:25:23 -0400 Alexander Belopolsky wrote: > When pickle.py needs to import a module by name, it goes through a > peculiar dance of > > __import__(module, level=0) > mod = sys.modules[module] > > As far as I can tell, unless builtins.__import__ is over

[Python-Dev] Peculiar import code in pickle.py

2010-07-13 Thread Alexander Belopolsky
When pickle.py needs to import a module by name, it goes through a peculiar dance of __import__(module, level=0) mod = sys.modules[module] As far as I can tell, unless builtins.__import__ is overridden or sys.modules clobbered by user code, the above should be equivalent t

Re: [Python-Dev] New regex module for 3.2?

2010-07-13 Thread Antoine Pitrou
On Tue, 13 Jul 2010 15:20:23 +0100 Michael Foord wrote: > On 13/07/2010 15:17, Reid Kleckner wrote: > > On Mon, Jul 12, 2010 at 2:07 PM, Nick Coghlan wrote: > > > >> MRAB's module offers a superset of re's features rather than a subset > >> though, so once it has had more of a chance to bake

Re: [Python-Dev] New regex module for 3.2?

2010-07-13 Thread Michael Foord
On 13/07/2010 15:17, Reid Kleckner wrote: On Mon, Jul 12, 2010 at 2:07 PM, Nick Coghlan wrote: MRAB's module offers a superset of re's features rather than a subset though, so once it has had more of a chance to bake on PyPI it may be worth another look. I feel like the new module is

Re: [Python-Dev] New regex module for 3.2?

2010-07-13 Thread Reid Kleckner
On Mon, Jul 12, 2010 at 2:07 PM, Nick Coghlan wrote: > MRAB's module offers a superset of re's features rather than a subset > though, so once it has had more of a chance to bake on PyPI it may be > worth another look. I feel like the new module is designed to replace the current re module, and s

Re: [Python-Dev] commit privs

2010-07-13 Thread Reid Kleckner
Thanks for the support! Georg Brandl authorized my SSH keys for SVN access. Reid On Tue, Jul 13, 2010 at 7:29 AM, Gregory P. Smith wrote: > > On Sun, Jul 11, 2010 at 9:28 AM, Antoine Pitrou wrote: >> >> On Sun, 11 Jul 2010 13:23:13 + >> Reid Kleckner wrote: >> > >> > I'm also expecting to

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Fred Drake
On Tue, Jul 13, 2010 at 9:00 AM, Nick Coghlan wrote: > Making sure both __main__ and the corresponding importable name refers > to the same module object seems reasonable. One detail that may not have been obvious when I described the persistent object problem; when class references are pickled,

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Nick Coghlan
> (Two different classes with the same name created - one from __main__ and > one from real_name.) Use cases for *genuinely* reimporting the same module > with different names (as different module objects rather than aliases) are > relatively rare, and the problem of modules *accidentally* reimport

Re: [Python-Dev] More C API abstraction for user defined types

2010-07-13 Thread Nick Coghlan
On Tue, Jul 13, 2010 at 6:44 PM, Mark Dickinson wrote: > On Mon, Jul 12, 2010 at 10:19 PM, Nick Coghlan wrote: >> On Tue, Jul 13, 2010 at 3:35 AM, Petre Galan wrote: >>> ival should not be resolved through PyLong_AsLong, but through >>> functionality/interface like PyNumber_Long > > +1, but I'd

Re: [Python-Dev] How to block a module import

2010-07-13 Thread Nick Coghlan
On Tue, Jul 13, 2010 at 10:37 AM, Alexander Belopolsky wrote: > In my experiments, 0 is not equivalent to None: > import sys, time sys.modules['time'] = 0 __import__('time') > 0 sys.modules['time'] = None __import__('time') > Traceback (most recent call last): >  File "",

Re: [Python-Dev] [Idle-dev] Removing IDLE from the standard library

2010-07-13 Thread Beni Cherniavsky-Paskin
On Sun, Jul 11, 2010 at 18:20, Tal Einat wrote: > The (hopefully) compelling arguments were others, such as the sentence > following the one you quoted: > > "I think that in its current state, IDLE may still be helpful for > learning Python, but it is more likely to drive away users who run > int

Re: [Python-Dev] python-checkins

2010-07-13 Thread Nick Coghlan
On Tue, Jul 13, 2010 at 11:05 AM, Stephen J. Turnbull wrote: > Antoine Pitrou writes: > >  > You don't have to receive e-mail from it. Just take a look at the >  > archives from time to time after you have done some commits. >  > In a threaded view, it's easy to spot the few messages which aren't

Re: [Python-Dev] New regex module for 3.2?

2010-07-13 Thread Vlastimil Brom
2010/7/8 MRAB : > Hi all, > > I re-implemented the re module, adding new features and speed > improvements. It's available at: > >    http://pypi.python.org/pypi/regex > > under the name "regex" so that it can be tried alongside "re". > > I'd be interested in any comments or feedback. How does it c

Re: [Python-Dev] Removing IDLE from the standard library

2010-07-13 Thread Antoine Pitrou
On Mon, 12 Jul 2010 19:08:07 -0400 Terry Reedy wrote: > On 7/12/2010 2:05 AM, "Martin v. Löwis" wrote: > >> What I specifically want right now is Commit Authorization Privilege, > >> especially for IDLE, > > > > Not sure who could grant that, but as far as I can: you have it. > > If I were approv

Re: [Python-Dev] avoiding accidental shadowing of top-level libraries by the main module

2010-07-13 Thread Michael Foord
On 13/07/2010 01:30, Steven D'Aprano wrote: On Tue, 13 Jul 2010 08:05:24 am Nick Coghlan wrote: On Tue, Jul 13, 2010 at 7:47 AM, Fred Drake wrote: On Mon, Jul 12, 2010 at 5:42 PM, Michael Foord wrote: I'm sure Brett will love this idea, but if it was impossible to reimpor

Re: [Python-Dev] Problem with executing python interpretetor on special build of win server 2003

2010-07-13 Thread Oleg Broytman
Hello. We'are sorry but we cannot help you. This mailing list is to work on developing Python (fixing bugs and adding new features to Python itself); if you're having problems using Python, please find another forum. Probably python-list (comp.lang.python) news group/mailing list is the best pl

Re: [Python-Dev] More C API abstraction for user defined types

2010-07-13 Thread Mark Dickinson
On Mon, Jul 12, 2010 at 10:19 PM, Nick Coghlan wrote: > On Tue, Jul 13, 2010 at 3:35 AM, Petre Galan wrote: >> ival should not be resolved through PyLong_AsLong, but through >> functionality/interface like PyNumber_Long +1, but I'd prefer it if PyNumber_Index were used, rather than PyNumber_Long

[Python-Dev] Problem with executing python interpretetor on special build of win server 2003

2010-07-13 Thread Бажен Ржеутский
Hello. Actual problem in the next, when i trying to execute portable python on my build then nothing happens, and the error code is 128. What does mean this code 128? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinf

Re: [Python-Dev] Intended behavior of backlash in raw strings

2010-07-13 Thread Simon Cross
On Tue, Jul 13, 2010 at 12:26 AM, John Arbash Meinel wrote: r"testing \" backslash and quote" > 'testing \\" backslash and quote' > > It happens that this is the behavior I want, but it seemed just as > likely to be an error. I tested it with python2.5 and 2.6 and got the > same results. The

Re: [Python-Dev] [Idle-dev] Removing IDLE from the standard library

2010-07-13 Thread Dirkjan Ochtman
On Tue, Jul 13, 2010 at 00:11, "Martin v. Löwis" wrote: There's a one-to-one mapping somewhere. >>> >>> Unfortunately, no: we don't have email addresses of all committers. >> >> What about the python-committers mailing list? That has at least all >> the active ones, correct? > > Probably. Als

Re: [Python-Dev] commit privs

2010-07-13 Thread Gregory P. Smith
On Sun, Jul 11, 2010 at 9:28 AM, Antoine Pitrou wrote: > On Sun, 11 Jul 2010 13:23:13 + > Reid Kleckner wrote: > > > > I'm also expecting to be doing more work merging unladen-swallow into > > the py3k-jit branch, so I was wondering if I could get commit > > privileges for that. > > It sound

Re: [Python-Dev] New regex module for 3.2?

2010-07-13 Thread Gregory P. Smith
On Thu, Jul 8, 2010 at 12:52 PM, MRAB wrote: > Hi all, > > I re-implemented the re module, adding new features and speed > improvements. It's available at: > >http://pypi.python.org/pypi/regex > > under the name "regex" so that it can be tried alongside "re". > > I'd be interested in any comm