[issue3208] function annotation for builtin and C function

2013-12-03 Thread Larry Hastings
Larry Hastings added the comment: Argument Clinic theoretically could support annotations for builtins, though it's never been tested. I don't know if it makes sense to close this bug yet. -- ___ Python tracker __

[issue3208] function annotation for builtin and C function

2013-12-03 Thread STINNER Victor
STINNER Victor added the comment: This issue has been addressed by the PEP 436 (Argument Clinic) which supports annotation per parameter and annotation on the return type. This PEP has been implemented in Python 3.4. I suggest to close the issue, but I would prefer that Larry closes the issue

[issue3208] function annotation for builtin and C function

2013-12-01 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : -- nosy: -alexandre.vassalotti stage: -> needs patch versions: +Python 3.5 -Python 3.0 ___ Python tracker ___ _

[issue3208] function annotation for builtin and C function

2012-06-19 Thread Benjamin Peterson
Benjamin Peterson added the comment: Awaiting a patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:

[issue3208] function annotation for builtin and C function

2012-06-19 Thread Ramchandra Apte
Ramchandra Apte added the comment: What is the status of this bug? -- nosy: +ramchandra.apte ___ Python tracker ___ ___ Python-bugs-li

[issue3208] function annotation for builtin and C function

2008-07-30 Thread Richard Boulton
Richard Boulton <[EMAIL PROTECTED]> added the comment: I don't think it's reasonable not to support multiple interpreters in a single process - they're quite widely used by mod_python and mod_wsgi, and probably by others. I'm not sure whether that's a problem here or not, though. If we need to

[issue3208] function annotation for builtin and C function

2008-07-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: The "First" argument does not apply here, we could just say "annotations are not a function invariant", but the "Second" argument is valid to me. A solution would be a global (or interpreter-local if we really want to support sub-inter

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Haoyu Bai
Haoyu Bai <[EMAIL PROTECTED]> added the comment: I found the explanation of why buitl-ins are immutable: For the curious: there are two reasons why changing built-in classes is disallowed. First, it would be too easy to break an invariant of a built-in type that is relied upon elsewhere, eithe

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: Shared libraries share code, not memory. But were you talking about sub-interpreters? http://docs.python.org/dev/c-api/init.html#Py_NewInterpreter mod_python uses them, but see the "Caveats" section of the doc.

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10963/unnamed ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: On Wed, Jul 23, 2008 at 8:44 PM, Haoyu Bai <[EMAIL PROTECTED]> wrote: > > Haoyu Bai <[EMAIL PROTECTED]> added the comment: > > As I understand, at least C extension modules, which built as shared > library, would be shared among Python int

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Haoyu Bai
Haoyu Bai <[EMAIL PROTECTED]> added the comment: As I understand, at least C extension modules, which built as shared library, would be shared among Python interpreter in different process space. Is that correct? ___ Python tracker <[EMAIL PROTECTED]>

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: There never should be multiple Python interpreters running in the same process, though. -- nosy: +benjamin.peterson ___ Python tracker <[EMAIL PROTECTED]>

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Haoyu Bai
Haoyu Bai <[EMAIL PROTECTED]> added the comment: I think there is reason that CFunctionObjects are immutable: single CFunctionObject is shared by mutiple Python interpreters, so any change of CFunctionObject would affect other Python interpreters. Is that right? If it should be immutable, the

[issue3208] function annotation for builtin and C function

2008-07-23 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: - A immmutable object may contain mutable members. Try with a tuple containing a list. Then, I don't think that something says that CFunctionObjects are immutable. They don't have any modifiable attribute, until today! - (Did I say "str

[issue3208] function annotation for builtin and C function

2008-07-22 Thread Haoyu Bai
Haoyu Bai <[EMAIL PROTECTED]> added the comment: By considering the implementing, some problems emerged. First of all, as we know, all CFunctionObject and their attributes are imutable, but the __annotations__ attribute should be a dict, and dict is mutable. So how to solve this? Secondly, t

[issue3208] function annotation for builtin and C function

2008-07-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: PyCFunctionObject has indeed no way to store annotations. This could be useful for extension module writers. The PyMethodDef structure could grow a "ml_annotations" member. A patch is welcome! -- nosy: +amaury.forgeotdarc reso

[issue3208] function annotation for builtin and C function

2008-07-15 Thread Haoyu Bai
Haoyu Bai <[EMAIL PROTECTED]> added the comment: Sorry I haven't state the issue clearly. For this issue I mean the built-in function should able to define an __annotations__ attribute, just like the __doc__ attribute, but not to access it in extension module. ___

[issue3208] function annotation for builtin and C function

2008-07-13 Thread Alexandre Vassalotti
Alexandre Vassalotti <[EMAIL PROTECTED]> added the comment: Extension modules can use PyFunction_GetAnnotations() to access and modify the annotations dictionary. In addition, PyFunction_SetAnnotations() can be used to add annotations. I added some documentation for these functions in r64934. -

[issue3208] function annotation for builtin and C function

2008-06-26 Thread Haoyu Bai
New submission from Haoyu Bai <[EMAIL PROTECTED]>: It is better if the function annotation(PEP 3107) can be supported by built-in function and C function writtin in extension module, just like the __doc__ attribute. -- messages: 68783 nosy: bhy severity: normal status: open title: functi