[Python-3000] Signature PEP

2006-05-02 Thread Sanghyeon Seo
Hi, PyPy people, What do you think about this Signature PEP? http://mail.python.org/pipermail/python-3000/2006-April/001249.html PyPy has something similar as pypy.interpreter.pycode.cpython_code_signature, and I think it's definitely a good idea to have some better interface than code.co_* and C

Re: [Python-3000] Automatically invoking str() in str.join()

2006-05-02 Thread Fredrik Lundh
Michael P. Soulier wrote: > > which, based on the law of design based on random sampling of c.l.python, > > indicates that the current situation is not optimal. > > I for one found the move to put join() as a string method _very_ > unintiutive, and rather arbitrary. Lets just be different for the

Re: [Python-3000] characters data type

2006-05-02 Thread Josiah Carlson
Talin <[EMAIL PROTECTED]> wrote: > Given that strings are going to be unicode, will there be a "characters" > data type to go along with the "bytes" data type? No. The content of bytes is an 8 bit integer. > And how is the bytes data type different from the existing array type? Effectively, y

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Paul Moore
On 5/2/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > A widget toolkit which pre-implements parts of particular applications > does make it easier to implement those applications, I agree. The > question in my mind is whether an application can be built even if > that particular widget is missing.

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Thomas Wouters
On 5/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: I'm running into something that may make me require parentheses aroundlambda's argument list.Lambda-lovers will probably jump all over me for suggesting this, and I doubt you'll go fir it, but what about just not allowing type annotations in la

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Giovanni Bajo
Bill Janssen <[EMAIL PROTECTED]> wrote: >> A control which displays and allows to interact with several lines of >> widgets (e.g. labels, images...). >> For example a buddy list in an Instant Messaging client. > > This seems like part of the application UI to me, not a toolkit issue. No. The tool

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Nick Coghlan
Guido van Rossum wrote: > (a) {testlist} and {genexp} with the empty set written as set(). <...> > As Raymond says, upheaval of other notations isn't worth the minor > convenience that set literals provide. +1 for option (a) If you went for a syntactic notation for the empty set, I'd want to use

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Nick Coghlan
Thomas Wouters wrote: > > On 5/1/06, *Guido van Rossum* <[EMAIL PROTECTED] > > wrote: > > I'm running into something that may make me require parentheses around > lambda's argument list. > > > Lambda-lovers will probably jump all over me for suggesting this, a

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Paul Moore wrote: > This is, of course, hard, as platforms offer widely differing widget > sets. Tough. Nobody said writing a portable GUI layer was going to be > easy. Indeed. I'd say this kind of issue has been the *most* difficult thing about designing and implementing PyGUI so far. One has to

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Michael Chermside
Thomas Wouters writes: > Lambda-lovers will probably jump all over me for suggesting > this, and I doubt you'll go fir it, but what about just not > allowing type annotations in lambda statements? They're > neutered anyway. Speaking as a lambda user... +1... Great Idea Thomas! Lambdas are for tiny

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Giovanni Bajo wrote: > > I can see the accessibility > > argument, but it is basically asking for the ability to drive an > > interface designed for use with a pointing device, without using a > > pointing device. I'm not sure this is a reasonable constraint. > > It is. Every GUI toolkit has thi

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Paul Moore
On 5/2/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > Paul Moore wrote: > > > This is, of course, hard, as platforms offer widely differing widget > > sets. Tough. Nobody said writing a portable GUI layer was going to be > > easy. > > Indeed. I'd say this kind of issue has been the *most* > difficult

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Josiah Carlson wrote: > Technically speaking, any toolkit which allows for scrolling and the > laying out of controls in a grid would be sufficient to implement this Although for large grids it could be prohibitively inefficient. You really want to implement this kind of thing in a way that doesn

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Bill Janssen wrote: > The Tk canvas widget is a nice one, I've never been fond of things like the Tkinter canvas that come with their own data structure. Usually I already have a data structure of my own, and all I want is a place to draw it. > I'm still not quite sure what the PyGUI "canvas" is

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Stefan Rank
on 02.05.2006 11:04 Giovanni Bajo said the following: > Bill Janssen <[EMAIL PROTECTED]> wrote: >>> In wxWidgets, the GUI system is able to calculate the minimal size >>> needed by each and any widget, and to prevent the user from resizing >>> the window below the calculated minimal size. = >> I'm

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Bill Janssen wrote: > > In wxWidgets, the GUI system is able to calculate the minimal size > > needed by each and any widget, and to prevent the user from resizing the > > window below the calculated minimal size. = > > I'm not sure that this is effectively possible in all cases, but the > "set_b

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Giovanni Bajo
Greg Ewing wrote: >>> I can see the accessibility >>> argument, but it is basically asking for the ability to drive an >>> interface designed for use with a pointing device, without using a >>> pointing device. I'm not sure this is a reasonable constraint. >> >> It is. Every GUI toolkit has this,

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Greg Ewing
Fredrik Lundh wrote: > I don't think PyGUI is good enough for a standard API; it feels way too > much "MFC era" for my tastes. Can you elaborate on what MFC-like characterstics it has that you don't like? I'm open to suggestions for improvement. -- Greg __

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread skip
Bill> I think a PyGUI mailing list would be a good thing, Skip. And a Bill> bug-tracker. And a CVS repository. Bill> I disagree, though, about this discussion being too detailed for Bill> this list. This is exactly the kind of discussion we need on this Bill> list -- what a

Re: [Python-3000] Metaclass syntax?

2006-05-02 Thread Bill Birch
On Tue, 2 May 2006 12:36 am, Guido van Rossum wrote: > This has usually been solved by creating a non-meta class whose only > purpose is to introduce the new metaclass. You'd write > > class TheLarch(KindsOfTrees, deciduous): ... > > and the metaclass would be called KindsOfTreesMeta. > > (Of cours

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Oleg Broytmann
On Wed, May 03, 2006 at 12:33:42AM +1200, Greg Ewing wrote: > PyGUI *should* automatically handle tabbing between text fields > and other controls that you normally type text into. It doesn't > currently go in for tabbing into buttons and check boxes, which > has always seemed silly and annoying to

Re: [Python-3000] characters data type

2006-05-02 Thread Guido van Rossum
On 5/1/06, Talin <[EMAIL PROTECTED]> wrote: > Given that strings are going to be unicode, will there be a "characters" > data type to go along with the "bytes" data type? No. I'm not sure what you mean by "characters" but the only characters that Python will support are Unicode characters. Python'

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Guido van Rossum
On 5/2/06, Michael Chermside <[EMAIL PROTECTED]> wrote: > Thomas Wouters writes: > > Lambda-lovers will probably jump all over me for suggesting > > this, and I doubt you'll go fir it, but what about just not > > allowing type annotations in lambda statements? They're > > neutered anyway. > > Speak

Re: [Python-3000] Metaclass syntax?

2006-05-02 Thread Guido van Rossum
On 5/2/06, Bill Birch <[EMAIL PROTECTED]> wrote: > On Tue, 2 May 2006 12:36 am, Guido van Rossum wrote: > > This has usually been solved by creating a non-meta class whose only > > purpose is to introduce the new metaclass. You'd write > > > > class TheLarch(KindsOfTrees, deciduous): ... > > > > an

Re: [Python-3000] Metaclass syntax?

2006-05-02 Thread Jonathan LaCour
Guido van Rossum wrote: > This has usually been solved by creating a non-meta class whose only > purpose is to introduce the new metaclass. You'd write > > class TheLarch(KindsOfTrees, deciduous): ... > > and the metaclass would be called KindsOfTreesMeta. I think many people find this ugly. I ha

Re: [Python-3000] characters data type

2006-05-02 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > Josiah claims that bytes is similar to a list and array('B'). Since > the array type already supports many list methods (more than bytes > ATM!) I'm not sure what he's after. It's more likely that bytes will > evolve to be more like str, growing meth

Re: [Python-3000] characters data type

2006-05-02 Thread Guido van Rossum
On 5/2/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > "Guido van Rossum" <[EMAIL PROTECTED]> wrote: > > Josiah claims that bytes is similar to a list and array('B'). Since > > the array type already supports many list methods (more than bytes > > ATM!) I'm not sure what he's after. It's more lik

Re: [Python-3000] bug in modulus?

2006-05-02 Thread Tim Peters
[Andrew Koenig, on the counter intuitive -1e-050 % 2.0 == 2.0 example] >> I disagree. For any two floating-point numbers a and b, with b != 0, it >> is always possible to represent the exact value of a mod b as a >> floating-point number--at least on every floating-point system I have ever >> enco

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Terry Reedy
"Nick Coghlan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If you went for a syntactic notation for the empty set, I'd want to use > {} and > make the empty dict {:}, by that idea didn't even make your list of > alternatives :) Those are my favorites also. The 2.x -> 3.0 edit

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Guido van Rossum
On 5/2/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Nick Coghlan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > If you went for a syntactic notation for the empty set, I'd want to use > > {} and > > make the empty dict {:}, by that idea didn't even make your list of > > alter

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Josiah Carlson
Greg Ewing <[EMAIL PROTECTED]> wrote: > Josiah Carlson wrote: > > > Technically speaking, any toolkit which allows for scrolling and the > > laying out of controls in a grid would be sufficient to implement this > > Although for large grids it could be prohibitively > inefficient. You really wan

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Jim Jewett
Many of these issues have already been discussed -- and solved -- in a web context, if you look at the w3c.org accessibility documents. On 5/1/06, Bill Janssen <[EMAIL PROTECTED]> wrote: > > You cannot assign a global key shortcut to every command, > > while you can assign a local hotkey to any m

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Jim Jewett
On 5/2/06, Greg Ewing <[EMAIL PROTECTED]> wrote: > PyGUI *should* automatically handle tabbing between text fields > and other controls that you normally type text into. It doesn't > currently go in for tabbing into buttons and check boxes, which > has always seemed silly and annoying to me. I mig

[Python-3000] Requirements for a standard GUI library

2006-05-02 Thread Talin
I'm afraid I'm going to have to blow the dust off of one of my pet rants, this one concerning the design and implementation of GUI toolkits. As someone who is familiar with about 20 different GUI toolkits (not including the half dozen or so that I've created for various projects), I've formed a

Re: [Python-3000] bug in modulus?

2006-05-02 Thread Guido van Rossum
This is way above my head. :-) The only requirement *I* would like to see is that for floats that exactly represent ints (or longs for that matter) the result ought of x%y ought to have the same value as the same operation on the corresponding ints (except if the result can't be represented exactl

[Python-3000] new sockets: code sample

2006-05-02 Thread tomer filiba
i've written a code sample of how i think the new socket module should look. it's only a *prototype*, but i find code is easier to explain than abstract ideas. i guess that if it is desired, it should be rewritten in C, or at least work with "_socket" instead of "socket". and like GvR said, the ex

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Greg Wilson
> Terry Reedy: > Those are my favorites also. The 2.x -> 3.0 edit of {} to {:} is trivial > for an auto-correct function. > Guido Who Needs No Surname: > That doesn't fix everybody's brain though. Given that sets are much less > universally useful than dicts I don't think that dict should "give i

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Raymond Hettinger
>That doesn't fix everybody's brain though. Given that sets are much >less universally useful than dicts I don't think that dict should >"give in". > > > > Right. Changes to the {} notation for empty dicts should be off the table lest we have a lifetime of regrets. Set literals are not worth

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Andrew McCollum
> Greg Wilson wrote: > I think {:} is more consistent/mnemonic than {} for empty dictionaries > even without sets. What makes "{:}" so intuitive and consistent? To me, it makes no sense, because ':' is the key/value separator and so why should I need it if there are no items? To me, it looks lik

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Georg Brandl
Raymond Hettinger wrote: >>That doesn't fix everybody's brain though. Given that sets are much >>less universally useful than dicts I don't think that dict should >>"give in". >> >> >> >> > Right. Changes to the {} notation for empty dicts should be off the > table lest we have a lifetime of reg

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Terry Reedy
"Stefan Rank" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There is absolutely no sensible reason at all, for a gui frame to be of > a fixed size! > None. > More precisely: the concept of a maximum size (except screen limits) for > a frame is asking for user dissatisfaction. > 'U

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Barry Warsaw
On Tue, 2006-05-02 at 12:05 -0700, Raymond Hettinger wrote: > I think Guido had the best solution. Use set() for empty sets, use {} > for empty dicts, use {genexp} for set comprehensions/displays, use > {1,2,3} for explicit set literals, and use {k1:v1, k2:v2} for dict > literals. We can alwa

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Guido van Rossum
Looks like we're converging on consensus about this issue. Perhaps someone can attempt an implementation in the p3yk (sic) branch? I'll add a line to PEP 3100; I don't see that a whole new PEP is necessary to summarize the discussion here. --Guido On 5/2/06, Barry Warsaw <[EMAIL PROTECTED]> wrote

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Mike Klaas
On 5/2/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > Looks like we're converging on consensus about this issue. Perhaps > someone can attempt an implementation in the p3yk (sic) branch? I'll > add a line to PEP 3100; I don't see that a whole new PEP is necessary > to summarize the discussion he

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Guido van Rossum
On 5/2/06, Mike Klaas <[EMAIL PROTECTED]> wrote: > On 5/2/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Looks like we're converging on consensus about this issue. Perhaps > > someone can attempt an implementation in the p3yk (sic) branch? I'll > > add a line to PEP 3100; I don't see that a wh

Re: [Python-3000] Requirements for a standard GUI library

2006-05-02 Thread Terry Reedy
"Talin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > there. I will, however, list what I believe are the qualities that make > an API great: > > - It should follow the UI conventions of the specific platform that > it is running on. Ideally, the user should not be able to tell t

Re: [Python-3000] characters data type

2006-05-02 Thread Talin
Guido van Rossum python.org> writes: > On 5/1/06, Talin acm.org> wrote: > > Given that strings are going to be unicode, will there be a "characters" > > data type to go along with the "bytes" data type? > > No. I'm not sure what you mean by "characters" but the only characters > that Python wil

Re: [Python-3000] characters data type

2006-05-02 Thread Guido van Rossum
On 5/2/06, Talin <[EMAIL PROTECTED]> wrote: > It appears that my question has been misunderstood by everyone; I'll try > to phrase it better: > > The short version is: will there be a mutable character array type? (which > I am calling "characters"?) There are no plans for this AFAIK. > First, I

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Jim Jewett
On 5/2/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > Anyone who is pushing for any GUI toolkit to make it into Py3k ... > Wandering through all of the widgets ... fully featured GUI toolkit really is. > ... not everything needs be implemented to the extent it is in wxWidgets or > wxPython, but

Re: [Python-3000] characters data type

2006-05-02 Thread Talin
Guido van Rossum python.org> writes: > On 5/2/06, Talin acm.org> wrote: > > It appears that my question has been misunderstood by everyone; I'll try > > to phrase it better: > > > > The short version is: will there be a mutable character array type? (which > > I am calling "characters"?) > > Th

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Delaney, Timothy (Tim)
Guido van Rossum wrote: >> Thomas Wouters writes: >>> Lambda-lovers will probably jump all over me for suggesting >>> this, and I doubt you'll go fir it, but what about just not >>> allowing type annotations in lambda statements? They're >>> neutered anyway. [snip Michael Chermside ;)] > Fine wi

Re: [Python-3000] Metaclass syntax?

2006-05-02 Thread Delaney, Timothy (Tim)
Jonathan LaCour wrote: > Guido van Rossum wrote: >> This has usually been solved by creating a non-meta class whose only >> purpose is to introduce the new metaclass. You'd write >> >> class TheLarch(KindsOfTrees, deciduous): ... >> >> and the metaclass would be called KindsOfTreesMeta. > >

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Jim Jewett
On 5/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: >... I'm settled on the following syntax for adding optional annotations > def foo(arg1name: typeexpr = defaultexpr, arg2: typeexpr = > defaultexpr, ...): ... Did you also decide that the annotations will have no effect by themselves, and w

Re: [Python-3000] [pypy-dev] Signature PEP

2006-05-02 Thread Armin Rigo
Hi Seo, On Tue, May 02, 2006 at 04:02:46PM +0900, Sanghyeon Seo wrote: > What do you think about this Signature PEP? > http://mail.python.org/pipermail/python-3000/2006-April/001249.html It's a language design issue so it's off topic :-) More seriously, sure, it would be nice to have some kind o

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Antoine Pitrou
Le mardi 02 mai 2006 à 18:14 -0400, Jim Jewett a écrit : > They can, by installing wxPython. How long would it take to > understand wxpython? My gut feel is "longer than it took to > understand Python", which makes it pretty heavyweight. Understanding wxPython in itself is not difficult (a tool

Re: [Python-3000] characters data type

2006-05-02 Thread Guido van Rossum
On 5/2/06, Talin <[EMAIL PROTECTED]> wrote: > As to whether or not flat arrays are a win over a stream-based interface, > I think it really depends on how well the array type supports incremental > growth. I'm mostly familiar with the behavior of STL arrays, which (for > small array sizes) doubles

Re: [Python-3000] Requiring () around lambda's argument list

2006-05-02 Thread Guido van Rossum
On 5/2/06, Jim Jewett <[EMAIL PROTECTED]> wrote: > On 5/1/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > >... I'm settled on the following syntax for adding optional annotations > > > def foo(arg1name: typeexpr = defaultexpr, arg2: typeexpr = > > defaultexpr, ...): ... > > Did you also decide

Re: [Python-3000] characters data type

2006-05-02 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > On 5/2/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > There are > > other things I would personally like to have in the bytes object (string > > methods are almost a requirement, some file-like methods would be > > convenient; to replace StringIO,

Re: [Python-3000] characters data type

2006-05-02 Thread Josiah Carlson
"Guido van Rossum" <[EMAIL PROTECTED]> wrote: > Better ways to do this might be [c]StringIO (in theory -- I don't know > if it's fast enough in practice, but this should be easy to test) or > the standard "".join() approach (which underlies > StringIO's implementation as well -- though not cString

Re: [Python-3000] characters data type

2006-05-02 Thread Guido van Rossum
On 5/2/06, Josiah Carlson <[EMAIL PROTECTED]> wrote: > This is one of the reasons why I'm pushing for some string methods on > the bytes object. Even if bytes resize themselves quickly during > 'extension', a single allocation with a single pass copy will be far > faster. It probably won't be qui

Re: [Python-3000] sets in P3K?

2006-05-02 Thread Neal Norwitz
On 5/2/06, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > I think Guido had the best solution. Use set() for empty sets, use {} > for empty dicts, use {genexp} for set comprehensions/displays, use > {1,2,3} for explicit set literals, and use {k1:v1, k2:v2} for dict > literals. We can always add

Re: [Python-3000] PyGUI in Py3K stdlib, more details

2006-05-02 Thread Fredrik Lundh
Antoine Pitrou wrote: > Including a simplistic GUI library in the stdlib is really *not* helpful > to developers, it can even be deceptive. what makes discussions like these impossible is that everyone is assuming that their own requirements apply to everyone. I strongly doubt that the "oh my go

Re: [Python-3000] characters data type

2006-05-02 Thread Fredrik Lundh
Guido van Rossum wrote: > Note that UTF-8 would make the implementation of Python's typical > string API painful; we currently assume (because it's true ;-) that > random access to elements and slices (__getitem__ and __getslice__) is > O(1). With UTF-8 these operations would be slow -- the simple