top | item 40934310

Show HN: Magic Top Hat, an infinite library for Python

3 points| grokkedit | 1 year ago |github.com

Just for fun I wanted to write a library that generates the functions you import from it at runtime using the context in which you called them.

It's just a joke, but it proves what I was always afraid of: dunder methods are way too powerful and sometimes python seems to be broken because of it.

2 comments

order

voidUpdate|1 year ago

Please put in the repo that its a joke too, I can see people actually using this, which is very scary. I only realised it was when I came to comment

grokkedit|1 year ago

I thought I was explicit enough in the README, but will add a warning as well!