0

Given the following dictionary comprehension

{key: func(key) for key in range(5) if func(key) is not None}

Can I somehow annotate this func(key) so I won't have ‏to calculate it twice? thanks in advance

DeepSpace
  • 78,697
  • 11
  • 109
  • 154
Billie
  • 8,938
  • 12
  • 37
  • 67

0 Answers0