Skip to content

Conversation

@dg-pb
Copy link
Contributor

@dg-pbdg-pb commented May 17, 2024

#119109

I went with option 1. It is cleaner, faster and has a natural flow.

Before:

fromfunctoolsimportpartialdeffunc(a, b, c=0): returna-b-cp1=partial(func, 1) print(p1(2)) # -1%timeitp1(2) # 100 nsp1.keywords['c'] =1print(p1(2)) # -2%timeitp1(2) # 234 nsdelp1.keywords['c'] print(p1(2)) # -1%timeitp1(2) # 144 ns

After:

p1=partial(func, 1) print(p1(2)) # -1%timeitp1(2) # 100 nsp1.keywords['c'] =1print(p1(2)) # -2%timeitp1(2) # 234 nsdelp1.keywords['c'] print(p1(2)) # -1%timeitp1(2) # 100 ns

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@dg-pb@sobolevn@nineteendo