Greg Ewing wrote:
> Stefan Behnel wrote:
>> So you'd always have to release your own read buffer before acquiring a
>> write buffer
>
> Yes, you really want to be able to upgrade your own lock
> from a read lock to a write lock, which means the provider
> has to keep track of who the lock holder i
Stefan Behnel wrote:
One question: what does that mean for the mutable bytearray class? How would
that handle locking?
In a single-threaded app, or one where only a single thread at a time
can access the object providing the buffer interface, no locking is
needed (that's the main advantage of
Nick Coghlan wrote:
> Stefan Behnel wrote:
>> One question: what does that mean for the mutable bytearray class? How
>> would that handle locking?
>
> No need to confuse the question of memory access with the question of
> thread synchronisation.
Fair enough. Single-threaded code is extremely com
Hi,
Is there a way to specify keyword-only arguments using the C API. I
searched through the mailing list archive, read PEP 3102 and grep-ed
the codebase, but I found nothing looking like a C API. So I am
wondering, is this a Python-only feature?
-- Alexandre
_
On Thu, Jun 5, 2008 at 7:02 PM, Nick Coghlan <[EMAIL PROTECTED]> wrote:
> Alexandre Vassalotti wrote:
>> Is there a way to specify keyword-only arguments using the C API. I
>> searched through the mailing list archive, read PEP 3102 and grep-ed
>> the codebase, but I found nothing looking like a C
On Thu, Jun 5, 2008 at 10:50 PM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
> I believe Alexandre is familiar with PyArg_ParseTupleAndKeywords(),
> but its API doesn't let you specify keywords that have no positional
> equivalent. He's after the C equivalent of
>
> def foo(*, a, b): ...
>
> where
Stefan Behnel wrote:
So that means it's fine to remove all locking related functionality from the
new buffer protocol and leave everything to application space, right?
Not quite all of it -- the buffer needs to be considered
as locked against moving between calls to getbuffer and
releasebuffer,
There are 2 disparate approaches to clearing/compacting free lists for
basic types:
- APIs of the form Py_ClearFreeList() called from gc.collect()
[class, frame, method, tuple & unicode types];
- APIs of the form Py_CompactFreeList() called from
sys._compact_freelists() [int & float types];
Alexandre Vassalotti wrote:
> Is there a way to specify keyword-only arguments using the C API. I
> searched through the mailing list archive, read PEP 3102 and grep-ed
> the codebase, but I found nothing looking like a C API. So I am
> wondering, is this a Python-only feature?
Cython also has it.
Greg Ewing wrote:
> Stefan Behnel wrote:
>> So that means it's fine to remove all locking related functionality
>> from the
>> new buffer protocol and leave everything to application space, right?
>
> Not quite all of it -- the buffer needs to be considered
> as locked against moving between calls
Stefan Behnel wrote:
> So that means it's fine to remove all locking related functionality from the
> new buffer protocol and leave everything to application space, right?
>
> Here is a patch for the PEP that reflects this.
I filed this as bug #3046.
http://bugs.python.org/issue3046
Stefan
___
11 matches
Mail list logo