Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread Ben Finney
zooko <[EMAIL PROTECTED]> writes: > I'm willing to bet that you will get the following answers: > > A1. foo [from 'import foo'] is a module. > > A2. bar [of 'bar-1.2.3.tar.gz'] is a package. > > A3. A distribution is a version of Linux that comes with a lot of > Free Software. > > > Unfort

Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread Terry Reedy
"zooko" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Folks: | Unfortunately these answers aren't quite right. A "package" is | actually a directory containing an __init__.py file, and a | distribution is actually what you think of when you say "package" -- | a reusable package o

Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread glyph
On 10:53 pm, [EMAIL PROTECTED] wrote: zooko wrote: Unfortunately these answers aren't quite right. A "package" is actually a directory containing an __init__.py file, and a distribution is actually what you think of when you say "package" -- a reusable package of Python code that you can,

Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread Nick Coghlan
zooko wrote: Folks: Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions: Q1. You type "import foo" and it works. What kind of thing is foo? foo is a package or a module. Not enough information is provide here to say which. Q2.

Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread Steve Holden
zooko wrote: Folks: Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions: Q1. You type "import foo" and it works. What kind of thing is foo? Q2. You go to the Python package index and download something named "bar-1.0.0.tar.gz". W

Re: [Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread Oleg Broytmann
On Wed, Apr 30, 2008 at 04:21:13PM -0600, zooko wrote: > so perhaps instead the implementors should start using the > terminology understood by the programmers: > > 1. A "module" shall henceforth be the name for either a foo.py file > (a single-file module), or a directory with an __init__.py

[Python-Dev] shal we redefine "module" and "package"?

2008-04-30 Thread zooko
Folks: Here's an experiment you can perform. Round up a Python programmer and ask him the following three questions: Q1. You type "import foo" and it works. What kind of thing is foo? Q2. You go to the Python package index and download something named "bar-1.0.0.tar.gz". What kind of

Re: [Python-Dev] Problems with the new super()

2008-04-30 Thread Guido van Rossum
The staticmethod thing isn't new; that's also the case in 2.x. The super() thing is a case of practicality beats purity. Note that you pay a small but measurable cost for the implicit __class__ (it's implemented as a "cell variable", the same mechanism used for nested scopes) so we wouldn't want t

[Python-Dev] Problems with the new super()

2008-04-30 Thread Armin Ronacher
Hi all, I blogged about that topic today which turned out to be a very bad idea, so I summarize it for the mailinglist here to hopefully start a discussion about the topic, which I think is rather important. In the last weeks something remarkable happened in the Python3 sources: self kinda became

Re: [Python-Dev] Module properties for C modules

2008-04-30 Thread Guido van Rossum
On Wed, Apr 30, 2008 at 2:17 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > As you all know modules don't support properties. However several places > and modules could use properties on module level. For example the > sys.py3k_warnings flag could be implemented with a property. Other flags >

[Python-Dev] Debian/alpha test_math failures

2008-04-30 Thread Mark Dickinson
Hello all, test_math is currently failing on the Debian/alpha buildbots (trunk and py3k). I've been trying, unsuccessfully, to figure out what's going wrong, and I'm starting to run out of ideas, so I thought I'd ask the list for help to see if anyone has any useful suggestions. Details of the fai

Re: [Python-Dev] Module properties for C modules

2008-04-30 Thread Christian Heimes
Benjamin Peterson schrieb: > Good idea. Perhaps eventually they could be extended to Python, but > they are definitely useful in C now. How about passing a list of > getsets to PyImport_InitModule(5)? Yeah, I've a similar idea with PyImport_InitModule5() and a list of structs containing name, gett

[Python-Dev] Another GSoC Student Introduction

2008-04-30 Thread Heiko Weinen
Hi! My name is Heiko N. Weinen and I was accepted as GSoC Student, too. Hoorray! The project i chose is about Filesystem Virtualisation for Python's Standard Library, hopefully something which will prove quite useful. :) Christian Heimes is my Mentor and I'd like to thank him right now for his h

Re: [Python-Dev] Module properties for C modules

2008-04-30 Thread Benjamin Peterson
On Wed, Apr 30, 2008 at 4:17 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > Hello Python Dev! > > As you all know modules don't support properties. However several places > and modules could use properties on module level. For example the > sys.py3k_warnings flag could be implemented with a p

[Python-Dev] Module properties for C modules

2008-04-30 Thread Christian Heimes
Hello Python Dev! As you all know modules don't support properties. However several places and modules could use properties on module level. For example the sys.py3k_warnings flag could be implemented with a property. Other flags in the sys module could benefit from read only properties, too. How

Re: [Python-Dev] Optimization of Python ASTs: How should we deal with constant values?

2008-04-30 Thread Martin v. Löwis
> This leaves us with a few options: 5. Reuse/Abuse Num(object) for arbitrary constants. AFAICT, this should work out of the box. > 1. A new AST expr node for constant values for types other than Str/Num > > I imagine this to be something like Const(PyObject* v), which is > effectively transl

Re: [Python-Dev] cStringIO buffer interface

2008-04-30 Thread Jean-Paul Calderone
On Wed, 30 Apr 2008 09:51:25 -0700, Guido van Rossum <[EMAIL PROTECTED]> wrote: On Wed, Apr 30, 2008 at 9:36 AM, Farshid Lashkari <[EMAIL PROTECTED]> wrote: I was just curious as to why cStringIO objects don't implement the buffer interface. cStringIO objects seem similar to string and array

Re: [Python-Dev] socket.try_reuse_address()

2008-04-30 Thread Raghuram Devarakonda
On Wed, Apr 30, 2008 at 2:07 PM, Trent Nelson <[EMAIL PROTECTED]> wrote: > > > This one will not work. > > > > >>> 'windows' in System.getProperty('os.name').lower() > > Traceback (innermost last): > > File "", line 1, in ? > > TypeError: string member test needs char left operand > > >>>

Re: [Python-Dev] socket.try_reuse_address()

2008-04-30 Thread Trent Nelson
> This one will not work. > > >>> 'windows' in System.getProperty('os.name').lower() > Traceback (innermost last): > File "", line 1, in ? > TypeError: string member test needs char left operand > >>> Interesting, which version of Jython were you using? > You may have to do something like > Sy

Re: [Python-Dev] socket.try_reuse_address()

2008-04-30 Thread Raghuram Devarakonda
On Wed, Apr 30, 2008 at 1:42 PM, Trent Nelson <[EMAIL PROTECTED]> wrote: > > if os.name == "nt": > > _socketmethods = _socketmethods + ('ioctl',) > > +_is_windows = True > > +elif os.name == 'java': > > +from java.lang import System > > +_is_windows = 'windows' in System.getP

Re: [Python-Dev] Optimization of Python ASTs: How should we deal with constant values?

2008-04-30 Thread Brett Cannon
On Wed, Apr 30, 2008 at 3:15 AM, Thomas Lee <[EMAIL PROTECTED]> wrote: > Hi all, > > I've been working on optimization of the AST, including the porting of the > old bytecode-level optimizations to the AST level. A few questions have come > up in the process of doing this, all of which are probabl

Re: [Python-Dev] socket.try_reuse_address()

2008-04-30 Thread Trent Nelson
> if os.name == "nt": > _socketmethods = _socketmethods + ('ioctl',) > +_is_windows = True > +elif os.name == 'java': > +from java.lang import System > +_is_windows = 'windows' in System.getProperty('os.name').lower() > +elif os.name == 'posix' and sys.platform == 'cygwin': > +

Re: [Python-Dev] socket.try_reuse_address()

2008-04-30 Thread Trent Nelson
> > Giampaolo Rodola' wrote: > > > Maybe it would be better considering Windows CE systems too: > > > > > > - if os.name == 'nt' > > > + if os.name in ('nt', 'ce') > > > > > Cygwin? I don't know how Unix-like it is. > > Yeah, that's a fair point, it's the behaviour of the > underlying Winsock API

Re: [Python-Dev] cStringIO buffer interface

2008-04-30 Thread Guido van Rossum
On Wed, Apr 30, 2008 at 9:36 AM, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > I was just curious as to why cStringIO objects don't implement the > buffer interface. cStringIO objects seem similar to string and array > objects, and those support the buffer protocol. Is there a reason > against

[Python-Dev] cStringIO buffer interface

2008-04-30 Thread Farshid Lashkari
Hello, I'm not sure if this is the right place to ask, so I apologize ahead of time if it is. I was just curious as to why cStringIO objects don't implement the buffer interface. cStringIO objects seem similar to string and array objects, and those support the buffer protocol. Is there a reason

[Python-Dev] Optimization of Python ASTs: How should we deal with constant values?

2008-04-30 Thread Thomas Lee
Hi all, I've been working on optimization of the AST, including the porting of the old bytecode-level optimizations to the AST level. A few questions have come up in the process of doing this, all of which are probably appropriate for discussion on this list. The code I'm referring to here ca