[Python-Dev] Looking for Memories of Python Old-Timers

2006-05-22 Thread Guido van Rossum
-- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail

Re: [Python-Dev] [Web-SIG] Adding wsgiref to stdlib

2006-05-22 Thread Guido van Rossum
://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] replace on empty strings

2006-05-24 Thread Guido van Rossum
string version is an anomaly. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python

Re: [Python-Dev] replace on empty strings

2006-05-24 Thread Guido van Rossum
any string contains infinitely many empty substrings). No. That's what older versions of Python did, and it was changed to the current behavior, except someone screwed up the edge case for 8-bit strings. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Cost-Free Slice into FromString constructors--Long

2006-05-25 Thread Guido van Rossum
to also take slice arguments; then everybody ends up doing duplicate work. If you really need this for speed, I recommend you make it a custom extension. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Import hooks falling back on built-in import machinery?

2006-05-25 Thread Guido van Rossum
mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] A Horrible Inconsistency

2006-05-25 Thread Guido van Rossum
? -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail

Re: [Python-Dev] A Horrible Inconsistency

2006-05-25 Thread Guido van Rossum
, that's debatable but can't be fixed until py3k -- surely lots of code (perhaps accidentally) depends on it. Still unclear which one \F wanted fixed... -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] [Python-checkins] whatever happened to string.partition ?

2006-05-25 Thread Guido van Rossum
? was this a real design or a Py3K bluesky idea? I suggest to forget about that particular idea and just do what you were thinking of originally. str.partition() and unicode.partition() should be as simple as possible, to cover the 80% use case FAST. -- --Guido van Rossum (home page: http

Re: [Python-Dev] partition() variants

2006-05-26 Thread Guido van Rossum
this be ('f', 'o', 'obar') or not? And what about: print s2(foobar).partition(x) Currently this prints (s2('foobar'), '', '') These are both fine with me. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing

Re: [Python-Dev] Low-level exception invariants?

2006-05-26 Thread Guido van Rossum
. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] epoll implementation

2006-05-26 Thread Guido van Rossum
://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] partition() variants

2006-05-26 Thread Guido van Rossum
Dörwald [EMAIL PROTECTED] wrote: Guido van Rossum wrote: On 5/26/06, Walter Dörwald [EMAIL PROTECTED] wrote: [...] And what happens if the separator is an instance of a subclass? class s2(str): def __repr__(self): return s2(%r) % str(self) print foobar.partition(s2(o

Re: [Python-Dev] warnings about missing __init__.py in toplevel directories

2006-05-26 Thread Guido van Rossum
that's the major use case. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python

Re: [Python-Dev] test_gzip/test_tarfile failure om AMD64

2006-05-29 Thread Guido van Rossum
but warning that this will change in 2.6. I'm not sure what we gain by leaving other std modules depending on struct's brokenness broken. But I may be misinterpreting which modules you're referring to. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Guido van Rossum
too many uses. I wouldn't be surprised if after INCREF and DECREF it's the most commonly used C API method... -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org

Re: [Python-Dev] test_gzip/test_tarfile failure om AMD64

2006-05-29 Thread Guido van Rossum
, Thomas proposed accepting it (whatever that means) until 3.0. Fine with me. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe

Re: [Python-Dev] Remove METH_OLDARGS?

2006-05-29 Thread Guido van Rossum
. These modules can be converted. I think that should be done for 2.5, but nothing else. Or, perhaps a deprecation warning could be generated if it is still used. I'll let Martin decide this one. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] [Python-checkins] r46300 - in python/trunk: Lib/socket.py Lib/test/test_socket.py Lib/test/test_struct.py Modules/_struct.c Modules/arraymodule.c Modules/socketmodule.c

2006-05-29 Thread Guido van Rossum
be polymorphic. read() can't be due to the asymmetry in the API. I guess struct objects are different.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] PEP 42 - New kind of Temporary file

2006-05-29 Thread Guido van Rossum
Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-05-29 Thread Guido van Rossum
), count, etc. Although Tim pointed out that replace() only regards n+1 empty strings as existing in a string of lenth n. So for consistency, find() should only find them in those places, too. And abc.count() should return 4. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Integer representation (Was: ssize_t question: longs in header files)

2006-05-29 Thread Guido van Rossum
proposal (int as ABC and two subclasses that may remain anonymous to the Python user); it'll save the alignment waste for short ints and will let us use a smaller int type for the size for long ints (if we care about the latter). -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Converting crc32 functions to use unsigned

2006-05-30 Thread Guido van Rossum
Seems ok, except I don't know what the backwards incompatibilities would be... On 5/30/06, Giovanni Bajo [EMAIL PROTECTED] wrote: Bob Ippolito wrote: It seems that we should convert the crc32 functions in binascii, zlib, etc. to deal with unsigned integers. +1!! -- --Guido van Rossum

Re: [Python-Dev] Segmentation fault of Python if build on Solaris 9 or 10 with Sun Studio 11

2006-05-30 Thread Guido van Rossum
that the binaries produced by the Sun compiler segfault... :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] [Python-checkins] r46300 - in python/trunk: Lib/socket.py Lib/test/test_socket.py Lib/test/test_struct.py Modules/_struct.c Modules/arraymodule.c Modules/socketmodule.c

2006-05-31 Thread Guido van Rossum
an underscore before _into. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev

Re: [Python-Dev] Possible bug in complexobject.c (still in Python 2.5)

2006-05-31 Thread Guido van Rossum
Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Search for empty substrings (was Re: Let's stop eating exceptions in dict lookup)

2006-05-31 Thread Guido van Rossum
! -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] SF patch #1473257: Add a gi_code attr to generators

2006-06-01 Thread Guido van Rossum
it ASAP IMO.) While we're still using SF, developers should probably get in the habit of sending an email to the assignee when assigning a bug... -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Removing Mac OS 9 cruft

2006-06-02 Thread Guido van Rossum
://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Unhashable objects and __contains__()

2006-06-03 Thread Guido van Rossum
it is an obstacle. (I do understand your use case -- I just don't believe it's as important as the bug-catching property you'd be throwing away by supporting that use case.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list

Re: [Python-Dev] How to fix the buffer object's broken char buffer support

2006-06-06 Thread Guido van Rossum
a buffer from a (unicode) string at all. Unhelpfully, -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Is implicit underscore assignment buggy?

2006-06-07 Thread Guido van Rossum
() lmnop Raymond ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-09 Thread Guido van Rossum
to maintain compatibility, so be it. Really? The old situation is really evil, and the new approach is at least marginally better by giving users a way to migrate to a new non-evil approach. What exactly is the backwards incompatibility you speak of? -- --Guido van Rossum (home page: http://www.python.org

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Guido van Rossum
Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-09 Thread Guido van Rossum
On 6/9/06, Nicko van Someren [EMAIL PROTECTED] wrote: On 9 Jun 2006, at 17:44, Guido van Rossum wrote: This is an elaborate joke, right? On 6/9/06, Noam Raphael [EMAIL PROTECTED] wrote: ... It's simply this: Currently, the expression x[] is a syntax error. I suggest

Re: [Python-Dev] file()

2006-06-12 Thread Guido van Rossum
, such code would have to be changed. --Guido On 6/12/06, Kristján V. Jónsson [EMAIL PROTECTED] wrote: I notice that file() throws an IOError when it detects an invalid mode string. Wouldn't a ValueError be more appropriate? -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Please stop changing wsgiref on the trunk

2006-06-12 Thread Guido van Rossum
to it going forward, and that we try to get rid of it as we can. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] 2.5 issues need resolving in a few days

2006-06-12 Thread Guido van Rossum
___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Import semantics

2006-06-12 Thread Guido van Rossum
this only if the imported module is really a Java package. If it's a Python package it should stick to python semantics if possible. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Should hex() yield 'L' suffix for long numbers?

2006-06-12 Thread Guido van Rossum
Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list

Re: [Python-Dev] External Package Maintenance (was Re: Please stop changing wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
On 6/12/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:43 AM 6/12/2006 -0700, Guido van Rossum wrote: On 6/12/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:04 AM 6/12/2006 -0700, Guido van Rossum wrote: IOW I think PEP 360 is an unfortunate historic accident, and we would be better

Re: [Python-Dev] Dropping externally maintained packages (Was: Please stop changing wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
on Python 3000. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive

Re: [Python-Dev] External Package Maintenance (was Re: Please stopchanging wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
On 6/12/06, Giovanni Bajo [EMAIL PROTECTED] wrote: Guido van Rossum wrote: I personally think that, going forward, external maintainers should not be granted privileges such as are being granted by PEP 360, and an inclusion of a package in the Python tree should be considered a fork

Re: [Python-Dev] Dropping externally maintained packages (Was:Please stop changing wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
any instances of that actually happened? That would be a problem with *any* code in the Python library, not just external contributions, so I'm not sure why external contribions should be treated any differently here. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] file()

2006-06-12 Thread Guido van Rossum
On 6/12/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: Yup, although it's a change in behavior that would need to be studied carefully for backwards incompatibilities. Usually it's given as a constant, so there won't be any problems; but there might be code

Re: [Python-Dev] Should hex() yield 'L' suffix for long numbers?

2006-06-12 Thread Guido van Rossum
annoying changes, I agree it should be left for P3K now regardless. I'll change the PEP accordingly to make this explicit. Agreed again. Thanks for updating the PEP. PS Tim: did you get my private email about SequenceMatcher? -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] file()

2006-06-12 Thread Guido van Rossum
No, because ValueError is the better exception for an invalid mode string. On 6/12/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: On 6/12/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: Yup, although it's a change in behavior that would need

Re: [Python-Dev] External Package Maintenance

2006-06-12 Thread Guido van Rossum
On 6/12/06, Edward C. Jones [EMAIL PROTECTED] wrote: Guido van Rossum wrote: developers contributing code without wanting to give up control are the problem. That hits the nail on the head. If something is added to the standard library, it becomes part of Python and must be controlled

Re: [Python-Dev] External Package Maintenance (was Re: Please stopchanging wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
are. Agreed. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail

Re: [Python-Dev] Dropping externally maintained packages (Was: Please stop changing wsgiref on the trunk)

2006-06-12 Thread Guido van Rossum
it themselves (or defend their change -- so a public discussion can ensue). Disagreements should not be settled by battling checkins; I'd like to see that developers who ignore this rule repeatedly risk having their commit privileges taken away temporarily. -- --Guido van Rossum (home page: http

Re: [Python-Dev] Source control tools

2006-06-12 Thread Guido van Rossum
? This might be a good OpenSpace topic if you haven't already secured your speaking slot. It so happens that I saw a talk about Mercurial at last week's baypiggies meeting and the author claimed that it's as fast as Git. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] socket._socketobject.close() doesn't really close sockets

2006-06-12 Thread Guido van Rossum
http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Scoping vs augmented assignment vs sets (Re: 'fast locals' in Python 2.5)

2006-06-14 Thread Guido van Rossum
Is it perhaps time to move this discussion to c.l.py? The behavior isn't going to change. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-18 Thread Guido van Rossum
. That cannot be the only motivation. He can have mutable values today without any new syntax. (Either he can use x[()] or he can use attribute assignment.) But more to the point, this discussion is pointless, since I won't accept the syntax change. -- --Guido van Rossum (home page: http

Re: [Python-Dev] An obscene computed goto bytecode hack for switch :)

2006-06-18 Thread Guido van Rossum
this to generate a computed goto, and I don't see a need for that -- if we decide to add that (either as syntax or as an automatic optimization) I see no problem adding a new bytecode. Python's bytecode is not sacred or frozen like Java's. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] PEP 338 vs PEP 328 - a limitation of the -m switch

2006-06-18 Thread Guido van Rossum
On 6/18/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 11:18 AM 6/18/2006 -0700, Guido van Rossum wrote: On 6/18/06, Nick Coghlan [EMAIL PROTECTED] wrote: The 'bug fix' solution would be: 1. Change main.c and PySys_SetPath so that '' is NOT prepended to sys.path when the -m

Re: [Python-Dev] Pre-PEP: Allow Empty Subscript List Without Parentheses

2006-06-18 Thread Guido van Rossum
On 6/18/06, Noam Raphael [EMAIL PROTECTED] wrote: 2006/6/18, Guido van Rossum [EMAIL PROTECTED]: But more to the point, this discussion is pointless, since I won't accept the syntax change. OK, too bad! But don't say I haven't warned you, when you will all use my fabulous package and get

Re: [Python-Dev] PEP 338 vs PEP 328 - a limitation of the -m switch

2006-06-18 Thread Guido van Rossum
. But it could theoretically affect search order for other modules. I still see nothing wrong with . After all that's also the default if you run a script using python path/to/file.py . -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Switch statement

2006-06-19 Thread Guido van Rossum
to the readability? I haven't had the time to follow this thread (still catching up on my Google 50%) but I'm not sure I agree with the idea that a switch should only exist for speedup. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] unicode imports

2006-06-19 Thread Guido van Rossum
be surprised if that rewrite were to use pure Python code.) Py3k will be released later than Python 2.6, but most likely before 2.7. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] PyString_FromFormat

2006-06-19 Thread Guido van Rossum
-- others will weigh in there). -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python

Re: [Python-Dev] Misleading error message from PyObject_GenericSetAttr

2006-06-19 Thread Guido van Rossum
TypeError and AttributeError is hopeless. But if you want to submit a patch to reduce a particular bit of inconsistency (without increasing it elsewhere) it might well be accepted. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python

Re: [Python-Dev] Bug: xml.dom.pulldom never gives you END_DOCUMENT events with an Expat parser

2006-06-19 Thread Guido van Rossum
mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] Switch statement

2006-06-19 Thread Guido van Rossum
On 6/19/06, Raymond Hettinger [EMAIL PROTECTED] wrote: Guido van Rossum wrote: On 6/18/06, Josiah Carlson [EMAIL PROTECTED] wrote: [...] Offering arbitrary expressions whose meaning can vary at runtime would kill any potential speedup (the ultimate purpose for having a switch statement

Re: [Python-Dev] Switch statement

2006-06-19 Thread Guido van Rossum
. OTOH the hash table semantics don't require us to commit to a definition of hashable, which is an advantage. How's that for a wishy-washy answer. :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python

Re: [Python-Dev] Switch statement

2006-06-19 Thread Guido van Rossum
someone give a complete implementation a try, and then try to modify as much standard library code as possible to use it. Then report back. That would be a very interesting experiment to do. (And thanks for the pointer to sre_compile.py as a use case!) -- --Guido van Rossum (home page: http

Re: [Python-Dev] uuid backward compatibility

2006-06-19 Thread Guido van Rossum
van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Switch statement

2006-06-19 Thread Guido van Rossum
game. Georg, are you up to it? Georg is a bot? :-) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] Switch statement

2006-06-20 Thread Guido van Rossum
On 6/19/06, Josiah Carlson [EMAIL PROTECTED] wrote: Guido van Rossum [EMAIL PROTECTED] wrote: Perhaps I misunderstood Josiah's comment; I thought he was implying that a switch should be significantly *faster* than if/elif, and was arguing against features that would jeopardize that speedup

Re: [Python-Dev] Switch statement

2006-06-20 Thread Guido van Rossum
over; it's still mostly relevant. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options

Re: [Python-Dev] Switch statement

2006-06-20 Thread Guido van Rossum
On 6/20/06, Greg Ewing [EMAIL PROTECTED] wrote: Guido van Rossum wrote: Well, the hypothetical use case is one where we have an arbitrary object of unknown origin or type, and we want to special-case treatment for a few known values. I'd need convincing that this use case is anything

Re: [Python-Dev] Switch statement

2006-06-20 Thread Guido van Rossum
On 6/20/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 12:26 PM 6/21/2006 +1200, Greg Ewing wrote: Guido van Rossum wrote: But it would be easy enough to define a dict-filling function that updates only new values. Or evaluate the case expressions in reverse order. -1; stepping

Re: [Python-Dev] Switch statement

2006-06-20 Thread Guido van Rossum
On 6/20/06, Guido van Rossum [EMAIL PROTECTED] wrote: case A: ... if x == A... cases S: ...if x in A... or perhaps (saving a keyword): case A: ... if x == A... case in S: ...if x in A... I was too quick with cut/paste here; I meant case S: ...if x in S... or case in S

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
it a bit I think that if it's not immediately contained in a function, it should be implemented as alternative syntax for an if/elif chain. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
reason for the syntax to be different from if/elif chains.) -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: (Note how I've switched to the switch-for-efficiency camp, since it seems better to have clear semantics and a clear reason for the syntax to be different from if/elif chains.) if you're now in the efficiency camp

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:16 AM 6/21/2006 -0700, Guido van Rossum wrote: After thinking about it a bit I think that if it's not immediately contained in a function, it should be implemented as alternative syntax for an if/elif chain. That worries me a little

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 09:55 AM 6/21/2006 -0700, Guido van Rossum wrote: BTW a switch in a class should be treated the same as a global switch. But what about a switch in a class in a function? Okay, now my head hurts. :) Welcome to the club. There's a Monty

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
++ programmers beware, although the syntax is familiar, this is really a name-binding statement, not a value-copying statement. There are many other examples. Function and class definition for example (look like definitions but are run-time constructs unlike in most other languages). Etc. -- --Guido van

Re: [Python-Dev] Switch statement

2006-06-21 Thread Guido van Rossum
= expression if var == constant sre.FOO: ... elif var == constant sre.BAR: ... elif var in constant (sre.FIE, sre.FUM): ... This gets pretty repetitive. One might suggest that 'case' could imply 'constant'...? -- --Guido van Rossum (home page: http

Re: [Python-Dev] ImportWarning flood

2006-06-21 Thread Guido van Rossum
the paths have changed. Are there other options to get rid of the warnings? Check out the -W command line option and the warnings module. These document how to suppress warnings. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python

Re: [Python-Dev] Allow assignments in 'global' statements?

2006-06-22 Thread Guido van Rossum
this feeling, surely you're overusing global. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
an interesting question for the language lawyers. That's no problem for the parser, as long as the expressions are indented. ABC did this. But I think I like an explicit case keyword better; it gives a better error message if the indentation is forgotten. -- --Guido van Rossum (home page: http

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/21/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 01:16 PM 6/21/2006 -0700, Guido van Rossum wrote: Yeah, but if you have names for your constants it would be a shame if you couldn't use them because they happen to be defined in the same scope. Maybe the real answer is to have a const

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Greg Ewing [EMAIL PROTECTED] wrote: Phillip J. Eby wrote: switch x: case == 1: foo(x) Aesthetically, I don't like that. Me neither. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
where to store the dict. I'd say that we should just add a warning against switches in nested functions that are called only once per definition. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
property of names, just like global. But that requires too much repetition when a constant is imported. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
# exposure, but I think I prefer the explicit when using approach... It may be not enough C# exposure, but I don't know exactly which approach you are referring to. -- --Guido van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: I've also been wondering whether the 'case' keyword is really necessary? Would any ambiguities or other parsing problems arise if you wrote: switch x: 1: foo(x) 2: bar(x

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: On 6/22/06, Georg Brandl [EMAIL PROTECTED] wrote: Guido van Rossum wrote: I've also been wondering whether the 'case' keyword is really necessary? Would any ambiguities or other parsing problems arise if you

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: So the constant would be evaluated at function definition time? I find that rather confusing. well, I find the proposed magic behaviour of case at least as confusing... It's not magic if it can be explained. def

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
you can see what I'm actually proposing, before the minutiae of responding the objections you raised to stuff I threw out either in my previous message or the message before that. Hopefully this will help. At 10:44 AM 6/22/2006 -0700, Guido van Rossum wrote: Please, think through the notion

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Guido van Rossum wrote: It's not magic if it can be explained. def goes over all the cases and evaluates them in the surrounding scope and freezes the meaning of the cases that way as long as the function object survives is not magic

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
van Rossum (home page: http://www.python.org/~guido/) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Switch statement

2006-06-22 Thread Guido van Rossum
On 6/22/06, Phillip J. Eby [EMAIL PROTECTED] wrote: At 12:54 PM 6/22/2006 -0700, Guido van Rossum wrote: Summarizing our disagreement, I think you feel that freeze-on-first-use is most easily explained and understood while I feel that freeze-at-def-time is more robust. I'm not sure how to get

Re: [Python-Dev] Switch statement

2006-06-23 Thread Guido van Rossum
On 6/23/06, Josiah Carlson [EMAIL PROTECTED] wrote: Guido van Rossum [EMAIL PROTECTED] wrote: (1) An expression of the form 'static' atom has the semantics of evaluating the atom at the same time as the nearest surrounding function definition. If there is no surrounding function definition

Re: [Python-Dev] Switch statement

2006-06-23 Thread Guido van Rossum
On 6/23/06, Alex Martelli [EMAIL PROTECTED] wrote: On 6/22/06, Guido van Rossum [EMAIL PROTECTED] wrote: Independent from this, I wonder if we also need static names of the form static name = expression which would be similar to name = static (expression) but also prevents

Re: [Python-Dev] Switch statement

2006-06-23 Thread Guido van Rossum
On 6/23/06, Eric Sumner [EMAIL PROTECTED] wrote: On 6/22/06, Guido van Rossum [EMAIL PROTECTED] wrote: (3) A switch is implemented using a dict which is precomputed at the same time its static expressions are precomputed. The switch expression must be hashable. Overlap between different

Re: [Python-Dev] Switch statement

2006-06-23 Thread Guido van Rossum
really hairy code. The semantics aren't 100% clear. I'm all for telling people you can do that yourself or even here is a standard library module that solves your problem. But the solution needs to satisfy a certain cleanliness standard. -- --Guido van Rossum (home page: http://www.python.org/~guido

Re: [Python-Dev] Switch statement

2006-06-23 Thread Guido van Rossum
are static and disallow assignments to these. It would also have to export __dict__ as a proxy that disallows such assignments. I think it can be made to work. I do think this would require static names as well as static expressions. This is definitely still in the brainstorm phase! -- --Guido van

<    5   6   7   8   9   10   11   12   13   14   >