[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
priority: release blocker -> 
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset da8be157f4e275c4c32b9199f1466ed7e52f62cf by Miss Islington (bot) 
in branch '3.10':
bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)
https://github.com/python/cpython/commit/da8be157f4e275c4c32b9199f1466ed7e52f62cf


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28624
pull_request: https://github.com/python/cpython/pull/30420

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-05 Thread miss-islington


miss-islington  added the comment:


New changeset 46e4c257e7c26c813620232135781e6c53fe8d4d by Inada Naoki in branch 
'main':
bpo-46236: Fix PyFunction_GetAnnotations() returned tuple. (GH-30409)
https://github.com/python/cpython/commit/46e4c257e7c26c813620232135781e6c53fe8d4d


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Inada Naoki


Change by Inada Naoki :


--
keywords: +patch
pull_requests: +28615
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30409

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I am quite sure this is due to PR 23316

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Yeah, the docs mention explicitly that is a dictionary or NULL.

--
priority: normal -> release blocker

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-04 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Pablo, should this be a release blocker?

--
nosy: +Dennis Sweeney, pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-02 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
nosy: +methane

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46236] PyFunction_GetAnnotations returning Tuple vs Dict

2022-01-02 Thread Daniel McCarney


New submission from Daniel McCarney :

Hi there,

This is my first Python bug, hope I haven't missed anything important.

I noticed that the PyFunction_GetAnnotations function from the C API is 
returning a PyTuple when I link Python 3.10 where historically it returned a 
PyDict.

The documentation for PyFunction_GetAnnotations for 3.10 (here[0]) says its 
return can be:
> a mutable dictionary or NULL

I'm not sure if:
* This is user error and I should adapt to this case in my dependent code when 
using Python 3.10+.
* This is a documentation error, and it should say "a mutable dictionary, set, 
or NULL"
* This is a regression in the C API that should be fixed.

I've made a small reproduction program (here[1]) that can be used to quickly 
demonstrate the difference in return type between the two Python versions for 
the same C program and .py inputs.

I also noticed that issue42202 (here[2]) landed an optimization in 3.10.x that 
changed the internal representation of annotations to a set - could that 
possibly be related? I'm not 100% sure!

Thanks!

[0]: https://docs.python.org/3/c-api/function.html#c.PyFunction_GetAnnotations
[1]: https://github.com/cpu/pyfunction_getannotations_test
[2]: https://bugs.python.org/issue42202

--
components: C API
messages: 409555
nosy: cpu
priority: normal
severity: normal
status: open
title: PyFunction_GetAnnotations returning Tuple vs Dict
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com