Steven Bethard wrote:
> It reminds me of one of my minor gripes about the standard lib -- a
> number of functions that take another function as an argument don't
> take *args and **kwargs to be passed to that function when it's
> called. The iter() alternate form is a common example of this. I
> wo
Jp Calderone:
> for chunk in iter(lambda: f1.read(CHUNK_SIZE), ''):
> f2.write(chunk)
Phillip J. Eby:
> More seriously, I think your translation makes an excellent argument in
> *favor* of having a do/while statement for greater clarity. :)
Michael Chermside
> Interesting... I had the oppo
Charles Cazabon <[EMAIL PROTECTED]> wrote:
> Indeed. The original poster seems to want something that would work (not
> necessarily look) like this:
>
> do:
>
> while
>
> with executed once prior to first being tested. But the
> above is ugly, and you can get much the same effect
Nicolas Fleury <[EMAIL PROTECTED]> wrote:
> Guido van Rossum wrote:
> > Why are you so excited about having until indented? You didn't give
> > any examples with multiple occurrences. A single occurrence works just
> > fine unindented, as PEP 315 has already shown.
>
> FWIW, I must say I disagree
Guido van Rossum wrote:
> Why are you so excited about having until indented? You didn't give
> any examples with multiple occurrences. A single occurrence works just
> fine unindented, as PEP 315 has already shown.
FWIW, I must say I disagree (about "works just fine"). I find PEP 315
counter-in
Michael Hudson wrote:
> if (ProfilerError == NULL)
> ProfilerError = PyErr_NewException("hotshot.ProfilerError",
>NULL, NULL);
> if (ProfilerError != NULL) {
> Py_INCREF(ProfilerError);
> PyModule_A
Armin> But it's all quite obscure.
If this was comp.lang.python I'd nominate this for QOTW...
Skip
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/opt
Hi Michael,
On Wed, Jun 15, 2005 at 03:26:00PM +0100, Michael Hudson wrote:
> > Hum, you probably don't want to know, but it works just fine to forget
> > a Py_INCREF before PyModule_AddObject() for the following reason:
>
> No, it's more complicated than that, at least in an embedded
> scenario
On 6/15/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
> In gen.throw(), are all three arguments required? Or do the value and
> traceback Nones need to be listed explicitly?
>
>g.throw(MyException)
>
> or
>
>g.throw(MyException, None, None)
>
> FWIW, I prefer the former. Tha
Thanks both for answers,
I read some articles you link and I'd to say - alot discussion around!
I also found some notes that mod_python use some technique other than
GIL to allow multi-threading in Apache 2.0. Does someone know anything
closer? Any links or so?
Sorry I raise this old stuff again
Armin Rigo <[EMAIL PROTECTED]> writes:
> Hi Skip,
>
> On Wed, Jun 15, 2005 at 06:35:10AM -0700, [EMAIL PROTECTED] wrote:
>> Why this worked is a bit mystical. Perhaps it never gets freed because the
>> object just happens never to be DECREF'd (but that seems unlikely).
>> /* Add the Dial
Armin Rigo <[EMAIL PROTECTED]> writes:
> Hi Michael,
>
> On Wed, Jun 15, 2005 at 01:35:35PM +0100, Michael Hudson wrote:
>> if (ProfilerError == NULL)
>> ProfilerError = PyErr_NewException("hotshot.ProfilerError",
>>NULL, NULL);
>
Hi Skip,
On Wed, Jun 15, 2005 at 06:35:10AM -0700, [EMAIL PROTECTED] wrote:
> Why this worked is a bit mystical. Perhaps it never gets freed because the
> object just happens never to be DECREF'd (but that seems unlikely).
> /* Add the Dialect type */
> + Py_INCREF(&Dialect_Type);
>
Hi Michael,
On Wed, Jun 15, 2005 at 01:35:35PM +0100, Michael Hudson wrote:
> if (ProfilerError == NULL)
> ProfilerError = PyErr_NewException("hotshot.ProfilerError",
>NULL, NULL);
> if (ProfilerError != NULL) {
>
Michael> ... (though I don't understand how _csv.c gets away
Michael> with line 1579)...
Michael> Oops; I meant line 1590.
Hmmm... Me either. Is it possible it was just never DECREF'd? I checked
in the obvious fix on both head and the 2.4 release branch.
Skip
Skip Montanaro <[EMAIL PROTECTED]> writes:
> Michael> So I went looking for other instances of the same problem. I
> Michael> didn't find any (though I don't understand how _csv.c gets away
> Michael> with line 1579)...
>
> Same reason the Py_INCREF of ProfileError isn't necessary I t
Michael> So I went looking for other instances of the same problem. I
Michael> didn't find any (though I don't understand how _csv.c gets away
Michael> with line 1579)...
Same reason the Py_INCREF of ProfileError isn't necessary I think.
PyDict_New() returns a new reference which is
> > I believe that Algol 68 loops looked like the following (in somewhat
> > more Python-like terms):
> >
> > [for [from ] [step ] to ]
> > [while ]
> > do od
> As far as I remember, it was:
> do
>
> while
>
> od
> It might be that this could be preceded by a 'for'
On Tue, 14 Jun 2005, "Martin v. Löwis" wrote:
> Guido van Rossum wrote:
>> Intel has a free (as in beer) C compiler for Linux. A friend of mine
>> is involved in its production and marketing. He would like to see how
>> "his" compiler does on Python -- does it work at all, and is there a
>> speedu
I've just fixed a bug where Py_INCREF wasn't called when it should
have been before a call to PyModule_AddObject (rev. 2.62 of
Modules/threadmodule.c).
So I went looking for other instances of the same problem. I didn't
find any (though I don't understand how _csv.c gets away with line
1579), but
Guido van Rossum wrote:
> Why are you so excited about having until indented? You didn't give
> any examples with multiple occurrences. A single occurrence works just
> fine unindented, as PEP 315 has already shown.
I hadn't actually thought about the temptation to try and have
multiple 'until' s
In gen.throw(), are all three
arguments required? Or do the value
and traceback Nones need to be listed explicitly?
g.throw(MyException)
or
g.throw(MyException, None, None)
FWIW, I prefer the former. That will make throw() as flexible as
the raise statement.
22 matches
Mail list logo