Re: [Python-3000] interpolated strings

2006-12-06 Thread Antoine
> (people who do interpolation tend to expect dynamic lexical scoping, not > static > object binding...) After thinking a bit about it, you are right. Or more precisely, "inline" interpolation with literals is mainly useful for quick-and-dirty scripts rather than full-blown apps. (this "quick-an

Re: [Python-3000] interpolated strings

2006-12-06 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Dec 6, 2006, at 7:04 AM, Fredrik Lundh wrote: > btw, note that you can get the same behaviour with today's Python: > > s = I("some string here with ", variable, " in it") > Or even s = I('some string here with $variable in it') or some day

Re: [Python-3000] interpolated strings

2006-12-06 Thread Fredrik Lundh
Antoine wrote: > s = i"some string here with {variable} in it" > > The Interpolation object captures the format string, as well as a dict of > the needed variables from the current locals and globals (here, the > "variable"). I'm not sure I can think of a way to explain to a new Python programmer

Re: [Python-3000] interpolated strings

2006-12-06 Thread Antoine
> Or perhaps simpler, a new kind of string literal would construct an > Interpolation object: Hmm, so Jan proposed something similar in the meantime. Sorry for the noise. ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mail

Re: [Python-3000] interpolated strings

2006-12-06 Thread Antoine
> On Wed, 6 Dec 2006, Ka-Ping Yee wrote: > and "%" is overloadable on the basis that the return type is determined > to be compatible with "some_type_that_signals_sql_interpolation". Those > are some mighty big "IF"s though, and you could still concoct cases > where things would break :-) Or perha