Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Guido van Rossum
> > [Greg Ewing] > >>* It seems to me that this same exception-handling mechanism > >>would be just as useful in a regular for-loop, and that, once > >>it becomes possible to put 'yield' in a try-statement, people > >>are going to *expect* it to work in for-loops as well. [Guido] > > (You can alre

Re: [Python-Dev] site enhancements (request for review)

2005-04-26 Thread Greg Ewing
Guido van Rossum wrote: I do that all the time without .pth files -- I just put all the common modules in a package and place the package in the directory containing the "main" .py files. That's fine as long as you're willing to put all the main .py files together in one directory, with everything

Re: [Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Guido van Rossum
> > Please don't propose a grand rewrite (even it's only a single module). > > Given that the API is mostly sensible, please propose gradual > > refactoring of the implementation, perhaps some new API methods, and > > so on. Don't throw away the work that went into making it work in the > > first p

Re: [Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Shane Hathaway
Bob Ippolito wrote: > The zipfile module is good enough to create input files for zipimport.. > which is well tested and generally works -- barring the fact that > zipimport has quite a few rough edges of its own. I certainly wouldn't > recommend it for any heavy duty tasks in its current state.

Re: [Python-Dev] defmacro

2005-04-26 Thread Stephen J. Turnbull
> "Andrew" == Andrew Koenig <[EMAIL PROTECTED]> writes: Andrew> Wel Shouldn't you have written Andrew> (mapcar car list-of-lists) Andrew> or am I missing something painfully obvious? Greg should have written (with-file "foo/blarg" 'do-something-with) too. I g

Re: [Python-Dev] Re: Caching objects in memory

2005-04-26 Thread Greg Ewing
Facundo Batista wrote: Aargh! Bad explanation. Or at least you're missing something: Not really. It's easier for me to show that id(3) is always the same and id([]) not, and let the kids see that's not so easy and you'll have to look deeper if you want to know better. I think Guido was saying that

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Greg Ewing
I don't think this proposal has any chance as long as it's dynamically scoped. It mightn't be so bad if it were lexically scoped, i.e. a special way of defining a function so that it shares the lexically enclosing scope. This would be implementable, since the compiler has all the necessary informat

Re: [Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Alan McIntyre
Bob Ippolito wrote: > One of the most useful things that could happen to the zipfile module > would be a stream interface for both reading and writing. Right now > it's slow and memory hungry when dealing with large chunks. The use > case that lead me to fix this bug is a tool that archives vide

Re: [Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Bob Ippolito
On Apr 26, 2005, at 8:24 PM, Guido van Rossum wrote: Someone should think about rewriting the zipfile module to be less hideous, include a repair feature, and be up to date with the latest specifications . -- and allow *deleting* a file from a zipfi

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Greg Ewing
Nick Coghlan wrote: def template(): # pre_part_1 yield None # post_part_1 yield None # pre_part_2 yield None # post_part_2 yield None # pre_part_3 yield None # post_part_3 def user(): block = template() with block: # do_part_1 with block: # do_part_2 with block

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Brian Sabbey
Nick Coghlan wrote: Accordingly, I would like to suggest that 'with' revert to something resembling the PEP 310 definition: resource = EXPR if hasattr(resource, "__enter__"): VAR = resource.__enter__() else: VAR = None try: try: BODY except:

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Josiah Carlson
[Guido] > OK, now you *must* look at the Boo solution. > http://boo.codehaus.org/Syntactic+Macros That is an interesting solution, requiring macro writers to actually write an AST modifier seems pretty reasonable to me. Whether we want macros or not... - Josiah __

Re: [Python-Dev] Re: scope-collapse (was: anonymous blocks)

2005-04-26 Thread Jim Jewett
On 4/26/05, Robert Brewer <[EMAIL PROTECTED]> wrote: > [Jim] > > Absolutely. Even giving up the XXX_FAST optimizations would > > still require new bytecode to not assume them. > I'm afraid I'm only familiar with CPython, but wouldn't callee locals > just map to XXX_FAST indices via the caller's c

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread Greg Ewing
[EMAIL PROTECTED] wrote: Actually I was thinking of something related the other day: > Wouldn't it be nice to be able to define/overload not only > operators but also control structures? That triggered off something in my mind that's somewhat different from what you went on to talk about. So far we

Re: [Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Guido van Rossum
> > Someone should think about rewriting the zipfile module to be less > > hideous, include a repair feature, and be up to date with the latest > > specifications . > > -- and allow *deleting* a file from a zipfile. As far as I can tell, > you now

Re: [Python-Dev] scope-collapse

2005-04-26 Thread Guido van Rossum
[Jim jewett] > The pretend-it-is-a-generator proposals try to specify that only > certain names will be shared, in only certain ways. Huh? I don't see it this way. There is *no* sharing between the frame of the generator and the frame of the block. The block is a permanent part of the frame surrou

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread Greg Ewing
Jim Jewett wrote: I had been thinking that the typical use would be during function (or class) definition. The overhead would be similar to that of decorators, and confined mostly to module loading. But that's too late, unless you want to resort to bytecode hacking. By the time the module is loade

Re: [Python-Dev] defmacro

2005-04-26 Thread Greg Ewing
Shane Holloway (IEEE) wrote: So, the question comes back to what are blocks in the language extensibility case? To me, they would be something very like a code object returned from the compile method. To this we would need to attach the globals and locals where the block was from. Then we cou

[Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread Jim Jewett
>> >> (3) Add macros. We still have to figure out how to limit their obfuscation. >> > nobody has given even a *remotely* >> > plausible mechanism for how exactly you would get code executed at >> > compile time. >> macros can (and *possibly* should) be evaluated at run-time. > We must still

Re: [Python-Dev] defmacro

2005-04-26 Thread Greg Ewing
Stephen J. Turnbull wrote: This doesn't feel right to me. By that argument, people would want to "improve" (mapcar (lambda (x) (car x)) list-of-lists) to (mapcar list-of-lists (x) (car x)) I didn't claim that people would feel compelled to eliminate all uses of lambda; only that, in those case

[Python-Dev] Re: scope-collapse (was: anonymous blocks)

2005-04-26 Thread Robert Brewer
[Jim Jewett] > (2) Add a way to say "Make this function I'm calling > use *my* locals and globals." This seems to meet all > the agreed-upon-as-good use cases, but there is disagreement > over how to sensibly write it. The calling function is > the place that could get surprised, but people who

Re: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Greg Ewing
Nick Jacobson wrote: But while you can mark functions to be called with the 'register' method, there's no 'unregister' method to remove them from the stack of functions to be called. You can always build your own mechanism for managing cleanup functions however you want, and register a single ate

[Python-Dev] Re: [Pythonmac-SIG] zipfile still has 2GB boundary bug

2005-04-26 Thread Charles Hartman
Someone should think about rewriting the zipfile module to be less hideous, include a repair feature, and be up to date with the latest specifications . -- and allow *deleting* a file from a zipfile. As far as I can tell, you now can't (except by

[Python-Dev] scope-collapse

2005-04-26 Thread Jim Jewett
[Jim Jewett] >> >> (2) Add a way to say "Make this function I'm calling use *my* locals >> >> and globals." This seems to meet all the agreed-upon-as-good use >> >> cases, but there is disagreement over how to sensibly write it. [Guido] >> > What happens to names that have a >> > different meani

[Python-Dev] Re: a few SF bugs which can (probably) be closed

2005-04-26 Thread Terry Reedy
"Ilya Sandler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Here a few sourceforge bugs which can probably be closed: > > [ 1168983 ] : ftplib.py string index out of range > Original poster reports that the problem disappeared after a patch > committed by Raymond Not clear to me

Re: [Python-Dev] python.org crashing Mozilla?

2005-04-26 Thread Fred L. Drake, Jr.
On Tuesday 26 April 2005 16:53, Paul Dubois wrote: > Three different computers running Linux / Mozilla are crashing Mozilla > when directed to python.org. A Netscape works ok. Are we hacked or are > we showing off? Paul, My Firefox 1.0.2 is fine. What version(s) of Mozilla, and what host pla

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Guido van Rossum
[Paul Moore] > *YUK* I spent a long time staring at this and wondering "where did b come > from?" > > You'd have to come up with a very compelling use case to get me to like this. I couldn't have said it better. I said it longer though. :-) -- --Guido van Rossum (home page: http://www.python.

RE: [Python-Dev] Re: atexit missing an unregister method

2005-04-26 Thread Raymond Hettinger
[Raymond Hettinger] > << Will mull it over for a while. My first impression is that try/finally > is a better tool for the scenario you outlined. >> [Nick Jacobson] > You're right. try/finally takes care of my sample scenario. There may > still be a case to be made for atexit.unregister(), th

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Guido van Rossum
[Jim Jewett] > >> (2) Add a way to say "Make this function I'm calling use *my* locals > >> and globals." This seems to meet all the agreed-upon-as-good use > >> cases, but there is disagreement over how to sensibly write it. The > >> calling function is the place that could get surprised, but p

[Python-Dev] python.org crashing Mozilla?

2005-04-26 Thread Paul Dubois
Three different computers running Linux / Mozilla are crashing Mozilla when directed to python.org. A Netscape works ok. Are we hacked or are we showing off? ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyt

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Paul Moore
On 4/26/05, Jim Jewett <[EMAIL PROTECTED]> wrote: > I'm not sure I understand this. The preferred way would be > to just stick the keyword before the call. Using 'collapse', it > would look like: > > def foo(b): > c=a > def bar(): > a="a1" > collapse foo("b1") >

RE: [Python-Dev] Problem with embedded python

2005-04-26 Thread Ugo Di Girolamo
Sorry. will do. Ugo -Original Message- From: "Martin v. Löwis" [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 26, 2005 2:31 PM To: Ugo Di Girolamo Cc: python-dev@python.org Subject: Re: [Python-Dev] Problem with embedded python Ugo Di Girolamo wrote: > What am I doing wrong? This is

Re: [Python-Dev] Problem with embedded python

2005-04-26 Thread Martin v. Löwis
Ugo Di Girolamo wrote: > What am I doing wrong? This is not the forum to ask this question, please use python-list@python.org instead. Regards, Martin ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev U

[Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Jim Jewett
>> (2) Add a way to say "Make this function I'm calling use *my* locals >> and globals." This seems to meet all the agreed-upon-as-good use >> cases, but there is disagreement over how to sensibly write it. The >> calling function is the place that could get surprised, but people >> who want thu

Re: [Python-Dev] Re: atexit missing an unregister method

2005-04-26 Thread Martin v. Löwis
Nick Jacobson wrote: > You're right. try/finally takes care of my sample scenario. There may > still be a case to be made for atexit.unregister(), though. No. Anybody in need of such a feature can easily unregister it. allregistrations=[] def _run(): for fn in allregistrations: fn() ate

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Nick Coghlan
Phillip J. Eby wrote: At 09:12 PM 4/24/05 -0600, Steven Bethard wrote: I guess it would be helpful to see example where the looping with-block is useful. Automatically retry an operation a set number of times before hard failure: with auto_retry(times=3): do_something_that_might_fail()

[Python-Dev] Problem with embedded python

2005-04-26 Thread Ugo Di Girolamo
I have the following code, that seems to make sense to me. However, it crashes about 1/3 of the times. My platform is Python 2.4.1 on WXP (I tried the release version from the msi and the debug version built by me, both downloaded today to have the latest version). The crash happens whil

Re: [Python-Dev] python.org crashing Mozilla?

2005-04-26 Thread Heiko Wundram
Am Dienstag, 26. April 2005 22:53 schrieb Paul Dubois: > Three different computers running Linux / Mozilla are crashing Mozilla > when directed to python.org. A Netscape works ok. Are we hacked or are > we showing off? Firefox on Gentoo works okay...? -- --- Heiko. listening to: Incubus - Megalo

[Python-Dev] Re: atexit missing an unregister method

2005-04-26 Thread Nick Jacobson
Raymond Hettinger wrote: << Will mull it over for a while. My first impression is that try/finally is a better tool for the scenario you outlined. >> You're right. try/finally takes care of my sample scenario. There may still be a case to be made for atexit.unregister(), though. --Nick Jacobs

[Python-Dev] Re: atexit missing an unregister method

2005-04-26 Thread Nick Jacobson
<< This seems like a poor argument for unregistering exit handlers. If you've registered an exit handler, why then explicitly do what you've already asked the system to do? >> 1. To free up memory for the rest of the program. 2. If the following block is in a loop, and you need to allocate & the

Re: [Python-Dev] Removing --with-wctype-functions support

2005-04-26 Thread M.-A. Lemburg
Martin v. LÃwis wrote: S.ÃaÄlar Onur wrote: I want to know status of http://mail.python.org/pipermail/python-dev/2004-December/050193.html this thread. The status is that they are still there. Due to lack of time on my part. Will python remove wctype functions support from its core? I don't know

RE: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Raymond Hettinger
[Nick Jacobson] > I was looking at the atexit module the other day; it seems like an elegant > way to ensure that resources are cleaned up (that the garbage collector > doesn't take care of). > > But while you can mark functions to be called with the 'register' method, > there's no 'unregister' me

Re: [Python-Dev] Removing --with-wctype-functions support

2005-04-26 Thread Martin v. Löwis
S.ÃaÄlar Onur wrote: > I want to know status of > http://mail.python.org/pipermail/python-dev/2004-December/050193.html > this thread. The status is that they are still there. > Will python remove wctype functions support from its core? I don't know what MAL's plans are these days, but it is li

Re: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Aahz
On Tue, Apr 26, 2005, Nick Jacobson wrote: > > I was looking at the atexit module the other day; it seems like an elegant > way to ensure that resources are cleaned up (that the garbage collector > doesn't take care of). > > But while you can mark functions to be called with the 'register' metho

Re: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Skip Montanaro
Nick> But while you can mark functions to be called with the 'register' Nick> method, there's no 'unregister' method to remove them from the Nick> stack of functions to be called. Nor is there any way to view Nick> this stack and e.g. call 'del' on a registered function. Nick

Re: [Python-Dev] atexit missing an unregister method

2005-04-26 Thread Guido van Rossum
On 4/26/05, Nick Jacobson <[EMAIL PROTECTED]> wrote: > I was looking at the atexit module the other day; it seems like an elegant > way to ensure that resources are cleaned up (that the garbage collector > doesn't take care of). > > But while you can mark functions to be called with the 'register'

[Python-Dev] atexit missing an unregister method

2005-04-26 Thread Nick Jacobson
I was looking at the atexit module the other day; it seems like an elegant way to ensure that resources are cleaned up (that the garbage collector doesn't take care of). But while you can mark functions to be called with the 'register' method, there's no 'unregister' method to remove them from

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Aahz
On Tue, Apr 26, 2005, Guido van Rossum wrote: > > Now there's one more twist, which you may or may not like. Presumably > (barring obfuscations or bugs) the handling of BreakFlow and > ContinueFlow by an iterator (or generator) is consistent for all uses > of that particular iterator. For example

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread ron adam
Hi, this is my first post here and I've been following this very interesting discussion as is has developed. A really short intro about me, I was trained as a computer tech in the early 80's... ie. learned transistors, gates, logic etc... And so my focus tends to be from that of a troublesho

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Michael Hudson
Samuele Pedroni <[EMAIL PROTECTED]> writes: > Michael Hudson wrote: > >> The history of iterators and generators could be summarized by >> saying that an API was invented, then it turned out that in practice >> one way of implementing them -- generators -- was almost universally >> useful. >> >> T

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Samuele Pedroni
Michael Hudson wrote: The history of iterators and generators could be summarized by saying that an API was invented, then it turned out that in practice one way of implementing them -- generators -- was almost universally useful. This proposal seems a bit like an effort to make generators good

Re: [Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Guido van Rossum
> (2) Add a way to say "Make this function I'm calling use *my* locals > and globals." This seems to meet all the agreed-upon-as-good use > cases, but there is disagreement over how to sensibly write it. The > calling function is the place that could get surprised, but people > who want thunks s

Re: [Python-Dev] Re: Caching objects in memory

2005-04-26 Thread Facundo Batista
On 4/26/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > Also, string literals that resemble Python identifiers > are often interned, although this is not guaranteed. > And this only applies to literals, not strings constructed > dynamically by the program (unless you explicitly apply > intern() to the

Re: [Python-Dev] Re: Caching objects in memory

2005-04-26 Thread Facundo Batista
On 4/25/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > I was in my second class of the Python workshop I'm giving here in one > > Argentine University, and I was explaining how to think using > > name/object and not variable/value. > > > > Using id() for being pedagogic about the objects, the

RE: [Python-Dev] defmacro

2005-04-26 Thread Andrew Koenig
> This doesn't feel right to me. By that argument, people would want > to "improve" > > (mapcar (lambda (x) (car x)) list-of-lists) > > to > > (mapcar list-of-lists (x) (car x)) > > Have you ever heard someone complain about that lambda, though? Wel Shouldn't you have written

[Python-Dev] Re: Re: Re: anonymous blocks

2005-04-26 Thread Terry Reedy
"Greg Ewing" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry Reedy wrote: The part you quoted was by Nick Coghlan, not me, as indicated by the >> (now >>>) instead of > (which would now be >>) in front of the lines. >>>Not supporting iterables makes it harder to write a cl

[Python-Dev] Re: anonymous blocks vs scope-collapse

2005-04-26 Thread Jim Jewett
Michael Hudson: > This proposal seems a bit like an effort to make generators good at > doing something that they aren't really intended -- or dare I say > suited? -- for. I think it is more an effort to use the right keyword, which has unfortunately already been claimed by generators (and li

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Nick Coghlan
Michael Hudson wrote: This is a non-starter, I hope. I really meant what I said in PEP 310 about loops being loops. The more I play with this, the more I want the 'with' construct to NOT be a loop construct. The main reason is that it would be really nice to be able to write and use a multipar

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Michael Hudson
On 26 Apr 2005, at 15:13, Michael Hudson wrote: So, here's a counterproposal! And a correction! with expr as var: ... code ... is roughly: def _(var): ... code ... try: expr(_) except Return, e: return e.value Cheers, mwh ___ Python-Dev mai

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Michael Hudson
Whew! This is a bit long... On 25 Apr 2005, at 00:57, Guido van Rossum wrote: After reading a lot of contributions (though perhaps not all -- this thread seems to bifurcate every time someone has a new idea :-) I haven't read all the posts around the subject, I'll have to admit. I've read the on

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Nick Coghlan
Reinhold Birkenfeld wrote: Nick Coghlan wrote: Guido van Rossum wrote: [snip] - I think there's a better word than Flow, but I'll keep using it until we find something better. How about simply reusing Iteration (ala StopIteration)? Pass in 'ContinueIteration' for 'continue' Pass in 'BreakItera

[Python-Dev] Removing --with-wctype-functions support

2005-04-26 Thread S . Çağlar Onur
Hi; I just subscribed this list, so i don't know whether this discussed before. If so, sorry. I want to know status of http://mail.python.org/pipermail/python-dev/2004-December/050193.html this thread. Will python remove wctype functions support from its core? If it will, what about locale-depend

[Python-Dev] Re: anonymous blocks

2005-04-26 Thread Reinhold Birkenfeld
Nick Coghlan wrote: > Guido van Rossum wrote: > [snip] >> - I think there's a better word than Flow, but I'll keep using it >> until we find something better. > > How about simply reusing Iteration (ala StopIteration)? > >Pass in 'ContinueIteration' for 'continue' >Pass in 'BreakIterati

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Greg Ewing
Guido van Rossum wrote: [Greg Ewing] * It seems to me that this same exception-handling mechanism would be just as useful in a regular for-loop, and that, once it becomes possible to put 'yield' in a try-statement, people are going to *expect* it to work in for-loops as well. (You can already put a

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Nick Coghlan
Guido van Rossum wrote: [snip] - I think there's a better word than Flow, but I'll keep using it until we find something better. How about simply reusing Iteration (ala StopIteration)? Pass in 'ContinueIteration' for 'continue' Pass in 'BreakIteration' for 'break' Pass in 'AbortIteration' f

[Python-Dev] Re: anonymous blocks

2005-04-26 Thread Reinhold Birkenfeld
Guido van Rossum wrote: > [Greg Ewing] >> I like the general shape of this, but I have one or two >> reservations about the details. > > That summarizes the feedback so far pretty well. I think we're on to > something. And I'm not too proud to say that Ruby has led the way here > to some extent (e

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread Michael Walter
On 4/26/05, Rodrigo Dias Arruda Senra <[EMAIL PROTECTED]> wrote: > IMVHO, macros are readability assassins. The power (for any developer) > to introduce new syntax is *not* a desirable feature, but something > to be avoided. And that alone should be a stronger argument than > a hundred use case

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Greg Ewing
Brett C. wrote: It executes the body, calling next() on the argument > name on each time through until the iteration stops. But that's no good, because (1) it mentions next(), which should be an implementation detail, and (2) it talks about iteration, when most of the time the high-level intent has

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread Rodrigo Dias Arruda Senra
[ Michael Walter ]: > A couple of examples out of my tired head (solely from a user perspective) :-) > > Embedding domain specific language (ex.: state machine): > ... > > Embedding domain specific language (ex.: markup language): > ... > > Embedding domain-specific language (ex.: badly-designed

Re: [Python-Dev] Re: anonymous blocks

2005-04-26 Thread Guido van Rossum
[Greg Ewing] > I like the general shape of this, but I have one or two > reservations about the details. That summarizes the feedback so far pretty well. I think we're on to something. And I'm not too proud to say that Ruby has led the way here to some extent (even if Python's implementation would

Re: RE: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-26 Thread flaig
Actually I was thinking of something related the other day: Wouldn't it be nice to be able to define/overload not only operators but also control structures? That way Python's core language could be kept simple and free of "featuritis" while at the same time everyone who desires a match/case or

Re: [Python-Dev] site enhancements (request for review)

2005-04-26 Thread Guido van Rossum
> While we're on the subject of .pth files, what about > the idea of scanning the directory containing the main > .py file for .pth files? This would make it easier to > have collections of Python programs sharing a common > set of modules, without having to either install them > system-wide or wri

Re: [Python-Dev] Re: switch statement

2005-04-26 Thread Guido van Rossum
> Greg> 1) Repeating the name of the thing being switched on all the > Greg> time, and the operator being used for comparison. > > What's worse, to my mind, is the not infrequent case where the thing > being switched on or the operator changes. Sure, that's bad style, > but sometimes you

Re: [Python-Dev] Re: switch statement

2005-04-26 Thread Stephen J. Turnbull
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes: Greg> Two things are mildly annoying about if-elif chains as a Greg> substitute for a switch statement: Greg> 1) Repeating the name of the thing being switched on all the Greg> time, and the operator being used for comparison.

Re: [Python-Dev] site enhancements (request for review)

2005-04-26 Thread Bob Ippolito
On Apr 26, 2005, at 1:12 AM, Greg Ewing wrote: Bob Ippolito wrote: A few weeks ago I put together a patch to site.py for Python 2.5 that solves three major deficiencies: > > [concerning .pth files] While we're on the subject of .pth files, what about the idea of scan

Re: [Python-Dev] defmacro

2005-04-26 Thread Stephen J. Turnbull
> "Greg" == Greg Ewing <[EMAIL PROTECTED]> writes: Greg> This raises the question of why people feel the need for Greg> macros in Lisp or Scheme, which have an even more minimal Greg> and flexible syntax. I think part of the reason is that the Greg> syntax for passing an uneval