#36978: Should django evaluate typing annotations at all?
-------------------------------------+-------------------------------------
     Reporter:  93578237             |                    Owner:  (none)
         Type:  Uncategorized        |                   Status:  closed
    Component:  Core (Other)         |                  Version:  5.2
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  typing, inspect,     |             Triage Stage:
  deferred annotations               |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Comment (by 93578237):

 {{{
 from inspect import *; from annotationlib import *; from typing import *

 if TYPE_CHECKING: x = int

 def foo(a: x) -> None: ...

 In [4]: %timeit signature(foo, annotation_format=Format.FORWARDREF)
 25 μs ± 445 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)

 In [5]: %timeit signature(foo, annotation_format=Format.STRING)
 12.4 μs ± 495 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
 }}}

 What am I missing?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36978#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019cce616fd9-cbe23706-306e-4370-9777-396585afa4ba-000000%40eu-central-1.amazonses.com.

Reply via email to