Maxwell Bernstein added the comment:
Ah, and another piece of the puzzle: this can happen in runtimes like Cinder
that provide their own native code entrypoints to functions like a __get__.
--
___
Python tracker
<https://bugs.python.
Change by Maxwell Bernstein :
--
components: +C API
___
Python tracker
<https://bugs.python.org/issue46561>
___
___
Python-bugs-list mailing list
Unsubscribe:
Maxwell Bernstein added the comment:
Hi Dennis,
Sorry, let me be more clear. CPython in general ensures that objects passed in
as arguments to a function will live for the duration of the function call if
they are otherwise untouched. As it is now, this invariant is not maintained
when
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +29158
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30979
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
Currently the descriptor (self) argument to __get__ is passed borrowed, since
_PyType_LookupId returns a borrowed reference (see _PyObject_LookupSpecial and
lookup_maybe_method in Objects/typeobject.c). This should instead own the
reference
Change by Maxwell Bernstein :
--
nosy: +tekknolagi
nosy_count: 5.0 -> 6.0
pull_requests: +28262
pull_request: https://github.com/python/cpython/pull/30036
___
Python tracker
<https://bugs.python.org/issu
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +28261
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30036
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
Avoid reference counting in the fast path of list.contains and list.index
--
messages: 408242
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: Add reference counting micro-optimizations to listobject.c
Change by Maxwell Bernstein :
--
resolution: -> rejected
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +28111
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29885
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
The documentation for the `re` module suggests several regular expressions for
use in simulating `scanf()`. Provide these directly in the `re` module.
--
components: Library (Lib)
messages: 407491
nosy: tekknolagi
priority: normal
severity
Change by Maxwell Bernstein :
--
pull_requests: +24879
pull_request: https://github.com/python/cpython/pull/26273
___
Python tracker
<https://bugs.python.org/issue36
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +21950
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/23031
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
assertNotInBytecode should only fail if:
* the instr matches and the arg is unspecified, or
* the instr matches, the arg is specified, and the arg matches
But right now it fails in a third case because of the dangling self.fail()
call. The self.fail
Change by Maxwell Bernstein :
--
keywords: +patch
nosy: +tekknolagi
nosy_count: 1.0 -> 2.0
pull_requests: +21704
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19940
___
Python tracker
<https://bugs.p
Maxwell Bernstein added the comment:
Oh, it looks like this has been done:
https://github.com/python/cpython/commit/ea62ce7f4fefc66bc0adba16bcd7666d5bbd5b44
Although I am not sure what version this made it into. So maybe this does not
affect versions 3.9/3.10. I've seen it in 3.6/6
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +20165
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/7477
___
Python tracker
<https://bugs.python.org/issu
Maxwell Bernstein added the comment:
See for example the following C program:
```
#define Py_LIMITED_API
#include "Python.h"
int main() {
Py_Initialize();
PyObject* foo;
PyIter_Check(foo);
}
```
when compiled (gcc test.c `pkg-config --cflags python3`) produces:
```
In fil
New submission from Maxwell Bernstein :
PyIter_Check is itself marked as available in the Limited API but:
a) it's a macro, and
b) it pokes directly at tp_iternext
This means that it's functionally impossible to use PyIter_Check
when working with the Limited API.
--
compone
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +19430
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/20125
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
builtin_input_impl does multiple attribute lookups in a row assuming they will
succeed, but part of attribute lookup assumes that there is no pending
exception.
I propose doing the lookups one by one and checking for an error after each.
There is an
Maxwell Bernstein added the comment:
Okay, well it doesn't provide the desired behavior of raising the error when
switching back and forth between manual and auto numbering, so I am looking
into that.
--
___
Python tracker
&
Maxwell Bernstein added the comment:
Looks like the patch solves my problem, so I am going to update my PR sometime
today.
--
___
Python tracker
<https://bugs.python.org/issue27
Maxwell Bernstein added the comment:
I'll take a look at the patch and see if this solves my problem. If it does,
I'll update my PR with tests.
--
___
Python tracker
<https://bugs.python.o
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +18418
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/19065
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
As I understand it, str.format and string.Formatter are supposed to behave the
same, with string.Formatter being a pluggable variant. While poking at
string.Formatter, I noticed that they do not behave the same when formatting a
nameless subscript
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +16529
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17002
___
Python tracker
<https://bugs.python.org/issu
New submission from Maxwell Bernstein :
This looks like a typo due to copy-paste.
--
messages: 355726
nosy: tekknolagi
priority: normal
severity: normal
status: open
title: Py_tp_free is specified twice in Python-ast.c
versions: Python 3.8
New submission from Maxwell Bernstein :
On a debug build, the following causes an abort:
import _io
_io.FileIO("foobar", opener=lambda name, flags: 100)
100 is not a valid fd. FileIO attempts to raise an IOError from errno, but
there is already an exceptio
Change by Maxwell Bernstein :
--
pull_requests: +13302
___
Python tracker
<https://bugs.python.org/issue36929>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Maxwell Bernstein :
--
nosy: +vstinner
___
Python tracker
<https://bugs.python.org/issue36929>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Maxwell Bernstein :
--
keywords: +patch
pull_requests: +13258
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue36929>
___
_
Maxwell Bernstein added the comment:
I have the beginnings of a PR to patch the test suite to make the prefix
optional, if anybody is interested.
--
___
Python tracker
<https://bugs.python.org/issue36
New submission from Maxwell Bernstein :
For a vanishingly small number of internal types, CPython sets the
tp_name slot to mod_name.type_name, either in the PyTypeObject or the
PyType_Spec. There are a few minor places where this surfaces:
* Custom repr functions for those types (some of which
Maxwell Bernstein added the comment:
I can likely do it tomorrow. If not I'll update this.
On Thu, Mar 7, 2019, 00:20 Windson Yang wrote:
>
> Windson Yang added the comment:
>
> It looks to me the fix is easy, we just will return NULL and raise
> TypeError when the call
Maxwell Bernstein added the comment:
NewProxy checks if it's callable, so I suppose the code should be fixed.
On Wed, Mar 6, 2019, 03:32 Windson Yang wrote:
>
> Windson Yang added the comment:
>
> Yes, Maxwell. I guess the docs are misleading, the code locate in
> https
New submission from Maxwell Bernstein :
The docs for `PyWeakref_NewRef` state "if callback is not callable, None, or
NULL, this will return NULL and raise TypeError". It does not appear as though
there is a callable check for the callback.
--
messages: 337255
nosy: Maxwell
37 matches
Mail list logo