M
Modular3mo ago
samufi

What does the keyword `capturing` do?

I noticed that the keyword capturing is necessary when I want to time code via time_function. For example,
from time import time_function

fn closure() capturing:
my_function()

print(time_function[closure]() * 1e-9)
from time import time_function

fn closure() capturing:
my_function()

print(time_function[closure]() * 1e-9)
What is going on under the hood if I am using the keyword capturing? I have not found documentation on this.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server