Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Daniel Waterworth
On 31 July 2010 02:21, Alexander Belopolsky wrote: > On Fri, Jul 30, 2010 at 2:46 PM, Daniel Waterworth > wrote: > .. >> Having thought it through thoroughly, my preference is for a warning. >> >> I don't think it's a good practise to import the __main__ module by >> filename, as renaming the fil

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Matthieu Brucher
2010/7/31 David Cournapeau : > On Fri, Jul 30, 2010 at 10:23 PM, Michael Foord > wrote: >> For those of you who found this document perhaps just a little bit too long, >> I've written up a *much* shorter intro to the plugin system (including how >> to get the prototype) on my blog: >> >>     http:

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Nick Coghlan
On Sat, Jul 31, 2010 at 12:34 AM, Michael Foord wrote: > Explicit registration over implicit registration by subclassing is an > interesting discussion, but I like the simplicity provided by just > subclassing. Note that ABCs are deliberately designed to let *users* choose to do either. Subclassi

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Alexander Belopolsky
On Fri, Jul 30, 2010 at 2:46 PM, Daniel Waterworth wrote: .. > Having thought it through thoroughly, my preference is for a warning. > > I don't think it's a good practise to import the __main__ module by > filename, as renaming the file will break the code. I got stung after, > having dropped int

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Nick Coghlan
On Sat, Jul 31, 2010 at 4:46 AM, Daniel Waterworth wrote: > Having thought it through thoroughly, my preference is for a warning. That's actually harder than it sounds. Inserting "__main__" into sys.modules under its normal name as well as "__main__" is actually pretty easy (for both direct exec

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread David Cournapeau
On Fri, Jul 30, 2010 at 10:23 PM, Michael Foord wrote: > For those of you who found this document perhaps just a little bit too long, > I've written up a *much* shorter intro to the plugin system (including how > to get the prototype) on my blog: > >     http://www.voidspace.org.uk/python/weblog/a

Re: [Python-Dev] pdb mini-sprint report and questions

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 4:07 PM, Georg Brandl wrote: > Am 31.07.2010 01:01, schrieb Guido van Rossum: >> Warning: 'p' is *not* the same as 'print'. 'p' is a built-in command >> that prints the expression's repr(). 'print' OTOH falls back through >> the interpreter and executes a print statement or

Re: [Python-Dev] pdb mini-sprint report and questions

2010-07-30 Thread Georg Brandl
Am 31.07.2010 01:01, schrieb Guido van Rossum: > On Fri, Jul 30, 2010 at 3:45 PM, Georg Brandl wrote: >> to warm up for tomorrow's 3.2alpha1 release, I did a mini-sprint on >> pdb issues today. I'm pleased to report that 14 issues could be closed, >> and pdb got a range of small new features, suc

Re: [Python-Dev] pdb mini-sprint report and questions

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 3:45 PM, Georg Brandl wrote: > to warm up for tomorrow's 3.2alpha1 release, I did a mini-sprint on > pdb issues today.  I'm pleased to report that 14 issues could be closed, > and pdb got a range of small new features, such as commands on the > command line, "until " or "lo

[Python-Dev] pdb mini-sprint report and questions

2010-07-30 Thread Georg Brandl
Hi, to warm up for tomorrow's 3.2alpha1 release, I did a mini-sprint on pdb issues today. I'm pleased to report that 14 issues could be closed, and pdb got a range of small new features, such as commands on the command line, "until " or "longlist" showing all the code for the current function (th

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Steven D'Aprano
On Sat, 31 Jul 2010 07:44:42 am Guido van Rossum wrote: > On Fri, Jul 30, 2010 at 1:53 PM, Barry Warsaw wrote: > > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it > >>should have known that they were using undefined behav

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" isillegal in Python 2.7?

2010-07-30 Thread Eric Snow
First appeared in docs for 2.6 (October 02, 2008). Not sure if that is when it first because constrained this way. http://docs.python.org/library/constants.html?highlight=__debug__#__debug__ -eric -Original Message- From: python-dev-bounces+esnow=verio@python.org [mailto:python-de

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 1:53 PM, Barry Warsaw wrote: > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it >>should have known that they were using undefined behavior that could >>change at any time. > > Shouldn't it be descri

Re: [Python-Dev] Speeding up 2to3: Results from a GSOC Project

2010-07-30 Thread Alexandre Vassalotti
Love it! BTW, it's not a good idea to have an import statement under 3 level of loops: https://code.google.com/p/2to3-speedup2/source/browse/trunk/lib2to3/refactor.py#427 -- Alexandre ___ Python-Dev mailing list Python-Dev@python.org http://mail.python

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guilherme Polo
2010/7/30 Barry Warsaw : > On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: > >>Well it is a reserved name so those packages that were setting it >>should have known that they were using undefined behavior that could >>change at any time. > > Shouldn't it be described here then? > > http://doc

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread P.J. Eby
At 04:37 PM 7/30/2010 +0200, Tarek Ziadé wrote: On Fri, Jul 30, 2010 at 4:04 PM, Barry Warsaw wrote: .. > * Registration - How do third party plugins declare themselves to exist, and > be enabled? Part of this seems to me to include interface declarations > too. Is installation of the plug

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread P.J. Eby
At 11:50 PM 7/30/2010 +0400, Oleg Broytman wrote: On Fri, Jul 30, 2010 at 07:46:44PM +0100, Daniel Waterworth wrote: > can anyone think of a case where someone has > been annoyed that, having imported that same module twice via > symlinks, they have had problems relating to modules being independ

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 21:56, P.J. Eby wrote: At 03:34 PM 7/30/2010 +0100, Michael Foord wrote: Automatic discoverability, a-la setuptools entry points, is not without its problems though. Tarek outlines some of these in a more recent blog post: FWIW, it's not discovery that's the problem, but configu

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread P.J. Eby
At 03:34 PM 7/30/2010 +0100, Michael Foord wrote: Automatic discoverability, a-la setuptools entry points, is not without its problems though. Tarek outlines some of these in a more recent blog post: FWIW, it's not discovery that's the problem, but configuring *which* plugins you wish to have

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Michael Foord
On 30/07/2010 21:53, Barry Warsaw wrote: On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: Well it is a reserved name so those packages that were setting it should have known that they were using undefined behavior that could change at any time. Shouldn't it be described here the

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Barry Warsaw
On Jul 30, 2010, at 01:42 PM, Guido van Rossum wrote: >Well it is a reserved name so those packages that were setting it >should have known that they were using undefined behavior that could >change at any time. Shouldn't it be described here then? http://docs.python.org/reference/lexical_analys

Re: [Python-Dev] Speeding up 2to3: Results from a GSOC Project

2010-07-30 Thread Guido van Rossum
Great! CS FTW! --Guido On Fri, Jul 30, 2010 at 1:28 PM, George Boutsioukis wrote: > Hi everyone, I haven't had a chance to introduce myself yet. I'm George > Boutsioukis, a CS student from Greece and I'm currently enrolled as a GSOC > student for the PSF. The task I was involved with for the pas

Re: [Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Guido van Rossum
On Fri, Jul 30, 2010 at 1:26 PM, Barry Warsaw wrote: > In working on making Python 2.7 available in Debian and Ubuntu, we ran into > two packages that fail to byte compile against Python 2.7, where they are fine > in Python 2.6.  The Debian bug tracker issues are: > >    http://bugs.debian.org/cgi

[Python-Dev] Speeding up 2to3: Results from a GSOC Project

2010-07-30 Thread George Boutsioukis
Hi everyone, I haven't had a chance to introduce myself yet. I'm George Boutsioukis, a CS student from Greece and I'm currently enrolled as a GSOC student for the PSF. The task I was involved with for the past few weeks was speeding up the 2to3 tool. For those who are not aware of 2to3's internal

[Python-Dev] Is it intentional that "sys.__debug__ = 1" is illegal in Python 2.7?

2010-07-30 Thread Barry Warsaw
In working on making Python 2.7 available in Debian and Ubuntu, we ran into two packages that fail to byte compile against Python 2.7, where they are fine in Python 2.6. The Debian bug tracker issues are: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=590821 http://bugs.debian.org/cgi-b

[Python-Dev] Bazaar branch of Python 2.7

2010-07-30 Thread Barry Warsaw
Hello all! For those of you who use the Bazaar mirrors on Launchpad of the Python Subversion branches (dvcs ftw! :), I've just registered the Python 2.7 maintenance branch. It will take a little while to complete the import, but when it's done you can grab it with: % bzr branch lp:python/2.7

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Oleg Broytman
On Fri, Jul 30, 2010 at 07:46:44PM +0100, Daniel Waterworth wrote: > can anyone think of a case where someone has > been annoyed that, having imported that same module twice via > symlinks, they have had problems relating to modules being independent > instances? I've had problems with two inst

[Python-Dev] configparser: `__name__` special key is mad

2010-07-30 Thread Łukasz Langa
Hello guys, I want to sum up all strange things about the behaviour of `__name__`, a special key present in every section of a parser instance. Hopefully it will be removed at once or in the worst case oficially deprecated and removed in 3.4. 1. There is a special `__name__` key in every sectio

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Daniel Waterworth
On 30 July 2010 18:32, Michael Foord wrote: > On 30/07/2010 17:59, Oleg Broytman wrote: >> >> On Fri, Jul 30, 2010 at 07:26:26AM +0100, Daniel Waterworth wrote: >> >>> >>> @Oleg: ... >>> This is purely CPython bug-fixing/the discussion of >>> implementation choices. >>> >> >>    I am not sure it's

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Tarek Ziadé
On Fri, Jul 30, 2010 at 5:54 PM, Éric Araujo wrote: >> It has an API, but the plugins are not interface based (so interface >> requirements don't need to be part of the plugin system). > > Oh, I see. With duck-typing and ABCs, I don’t make a difference between > protocols and interfaces in my head

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Michael Foord
On 30/07/2010 17:59, Oleg Broytman wrote: On Fri, Jul 30, 2010 at 07:26:26AM +0100, Daniel Waterworth wrote: @Oleg: ... This is purely CPython bug-fixing/the discussion of implementation choices. I am not sure it's a bug. It isn't a bug but it's a very common *cause* of bugs, ev

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Oleg Broytman
On Fri, Jul 30, 2010 at 07:26:26AM +0100, Daniel Waterworth wrote: > @Oleg: ... > This is purely CPython bug-fixing/the discussion of > implementation choices. I am not sure it's a bug. By manipulating sys.path (or symlinks in the FS) one can import the same file as different modules as many ti

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Raymond Hettinger
On Jul 30, 2010, at 6:23 AM, Michael Foord wrote: > For those of you who found this document perhaps just a little bit too long, > I've written up a *much* shorter intro to the plugin system (including how to > get the prototype) on my blog: > > http://www.voidspace.org.uk/python/weblog/ar

[Python-Dev] Summary of Python tracker Issues

2010-07-30 Thread Python tracker
ACTIVITY SUMMARY (2010-07-23 - 2010-07-30) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue number. Do NOT respond to this message. 2804 open (+45) / 18443 closed (+27) / 21247 total (+72) Open issues with patches: 1151 Ave

Re: [Python-Dev] unexpected import behaviour

2010-07-30 Thread Daniel Waterworth
On 29 July 2010 07:32, Daniel Waterworth wrote: > Hi, > > I'm not sure if this is a bug or not, I certainly didn't expect it. If > you create a file called test.py with the following contents, > > class Test: >    pass > > def test_1(): >    import test >    print Test == test.Test > > if __name__

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Éric Araujo
> It has an API, but the plugins are not interface based (so interface > requirements don't need to be part of the plugin system). Oh, I see. With duck-typing and ABCs, I don’t make a difference between protocols and interfaces in my head :) Also, the I in API does mean interface, but not imply b

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 16:28, Éric Araujo wrote: Le 30/07/2010 17:04, Michael Foord a écrit : There is no type checking or interface requirements in my plugin proposal for unittest. It is essentially an event based system. Event-based sounds good. unittest2 does have an interface IMO: configur

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Éric Araujo
Le 30/07/2010 17:04, Michael Foord a écrit : > There is no type checking or interface requirements in my plugin > proposal for unittest. It is essentially an event based system. Event-based sounds good. unittest2 does have an interface IMO: configuration loading, plugin registration/activation, s

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 15:41, Marty Alchin wrote: This is my first post to python-dev, so for those who might not know me, I'm the author of Pro Django and more recently, Pro Python. I haven't looked at the plugin landscape in a while, but I was very disappointed the last time I looked at how complex typ

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 15:37, Tarek Ziadé wrote: On Fri, Jul 30, 2010 at 4:04 PM, Barry Warsaw wrote: .. * Registration - How do third party plugins declare themselves to exist, and be enabled? Part of this seems to me to include interface declarations too. Is installation of the plugin enough

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Tarek Ziadé
On Fri, Jul 30, 2010 at 4:34 PM, Michael Foord wrote: ... > Again I think the *needs* of unittest and distutils are different, so I > wonder if a single system can usefully suit both our needs (let alone > universally support other systems). Definitely an area worth exploring > though. Yes, even

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Marty Alchin
This is my first post to python-dev, so for those who might not know me, I'm the author of Pro Django and more recently, Pro Python. I haven't looked at the plugin landscape in a while, but I was very disappointed the last time I looked at how complex typical systems were in this regard. There see

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Tarek Ziadé
On Fri, Jul 30, 2010 at 4:04 PM, Barry Warsaw wrote: > You guys should definitely write up a plugin PEP! I am all for it, I am pretty sure we can come up with a generic tool that can be useful for many packages in the stdlib Starting this... -- Tarek Ziadé | http://ziade.org

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Tarek Ziadé
On Fri, Jul 30, 2010 at 4:04 PM, Barry Warsaw wrote: .. > * Registration - How do third party plugins declare themselves to exist, and >  be enabled?  Part of this seems to me to include interface declarations >  too.  Is installation of the plugin enough to register it?  How do end users >  enabl

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 15:04, Barry Warsaw wrote: On Jul 30, 2010, at 11:38 AM, Michael Foord wrote: I'm going to read your blog entry on the topic to evaluate it properly though: https://tarekziade.wordpress.com/2009/05/01/basic-plugin-system-using-abcs- and-the-extensions-package/ Very int

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Barry Warsaw
On Jul 30, 2010, at 11:38 AM, Michael Foord wrote: >I'm going to read your blog entry on the topic to evaluate it properly >though: > >https://tarekziade.wordpress.com/2009/05/01/basic-plugin-system-using-abcs- >and-the-extensions-package/ Very interesting. For Mailman 3, I have YAPS (yet anothe

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
For those of you who found this document perhaps just a little bit too long, I've written up a *much* shorter intro to the plugin system (including how to get the prototype) on my blog: http://www.voidspace.org.uk/python/weblog/arch_d7_2010_07_24.shtml#e1186 Michael On 29 July 2010 23:55, Mi

Re: [Python-Dev] Basic Information about Python

2010-07-30 Thread Durga D
Thank you for your response. Regards, Durga. On Fri, Jul 30, 2010 at 6:05 PM, Oleg Broytman wrote: > Hello. > > We are sorry but we cannot help you. This mailing list is to work on > developing Python (adding new features to Python itself and fixing bugs); > if you're having problems learning

Re: [Python-Dev] Basic Information about Python

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

[Python-Dev] Basic Information about Python

2010-07-30 Thread Durga D
Hi All, I am new to python based application developement. I am using Windows XP. 1. Can I create desktop application (just hello world program) with Python language like exe in VC++? 2. If First statement is Yes, Can I include this application with my existing setup(assume 10 MB) for win

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Michael Foord
On 30/07/2010 11:09, Tarek Ziadé wrote: On Fri, Jul 30, 2010 at 12:55 AM, Michael Foord wrote: ... The Plugin Class A sometimes-more-convenient way of creating plugins is to subclass the ``unittest2.events.Plugin`` class. By default subclassing ``Plugin`` will auto-instan

Re: [Python-Dev] proto-pep: plugin proposal (for unittest)

2010-07-30 Thread Tarek Ziadé
On Fri, Jul 30, 2010 at 12:55 AM, Michael Foord wrote: ... > > The Plugin Class > > > A sometimes-more-convenient way of creating plugins is to subclass the > ``unittest2.events.Plugin`` class. By default subclassing ``Plugin`` will > auto-instantiate the plugin and store the inst