Re: [Python-Dev] PEP: __source__ proposal

2004-12-04 Thread Nick Coghlan
[Resend, since a minor brain explosion caused me to send this to c.l.p instead of python-dev] Stelios Xanthakis wrote: It appears that there are the 'module people' who find this feature irrelevant. Indeed. If we are interested in distributing modules and increasing the number of people who use p

Re: [Python-Dev] PEP: __source__ proposal

2004-12-04 Thread "Martin v. Löwis"
Stelios Xanthakis wrote: The key point is that I think think should be the job of the parser and the functionality provided at the interactive prompt w/o the user having to write 'dyndef' or store the code of exec's or request from himself to use specific commands to create functions. It should be

Re: [Python-Dev] PEP: __source__ proposal

2004-12-04 Thread Stelios Xanthakis
I'm opposed to this idea. It creates overhead in the size of .pyc files, No it doesn't. for no additional value that couldn't be obtained otherwise. Martin: I know it is possible to do all this with existing python facilities. I did write such a dynamic code framework in python. Specifically I u

Re: [Python-Dev] PEP: __source__ proposal

2004-12-04 Thread holger krekel
[Stelios Xanthakis Fri, Dec 03, 2004 at 11:59:30PM +0200] > On Fri, 3 Dec 2004, holger krekel wrote: > >We are about to test out this approach with the py lib > >(http://codespeak.net/py) and want to have it work for > >for Python 2.2, 2.3. and 2.4. > > Do you plan hacking python ? > It appears th

[Python-Dev] PEP: __source__ proposal

2004-12-03 Thread Michael Walter
Hi! I think you were the omitting the more interesting closure examples (namely with free variables inside the closure's source): def foo(): pass def bar(x): def fiep(): return x() return fiep what's bar(foo).__source__? Generally, I'm opposed to the feature -- I don't think it provides a r

Re: [Python-Dev] PEP: __source__ proposal

2004-12-03 Thread "Martin v. Löwis"
Stelios Xanthakis wrote: Now that 2.4 is out and everything maybe it's about time to start discussing the "use the __source__ Luke" feature which IMO will really boost python into a new domain of exciting possibilities. I'm opposed to this idea. It creates overhead in the size of .pyc files, for no

Re: [Python-Dev] PEP: __source__ proposal

2004-12-03 Thread Stelios Xanthakis
On Fri, 3 Dec 2004, holger krekel wrote: ... there is another possibility for storing "source" or any other such meta information with code/module objects: make __file__ and co_filename instances of a subclass of 'str' providing an extra attribute. For a simple example, they could have a 'source'

Re: [Python-Dev] PEP: __source__ proposal

2004-12-03 Thread holger krekel
Hi Stelios, [Stelios Xanthakis Fri, Dec 03, 2004 at 11:54:25AM +0200] > Abstract > > This PEP suggests the implementation of __source__ attribute for > functions and classes. The attribute is a read-only string which > is generated by the parser and is a copy of the original source

[Python-Dev] PEP: __source__ proposal

2004-12-03 Thread Stelios Xanthakis
Hi all. Now that 2.4 is out and everything maybe it's about time to start discussing the "use the __source__ Luke" feature which IMO will really boost python into a new domain of exciting possibilities. I've prepared a pre-PEP which is not very good but it is a base. In short, the feature is good a