igrek51
Re:Show HN: Wat – Deep inspection of Python objects
on Friday July 26, 2024 @06:47AM (#41077523)
Right, that would be a wrong pipe direction. Fun fact: It's already possible to do "wat | foo" or "wat << foo" (if you're more familiar with C++ iostream), it has the same effect as "wat / foo"
Re:Show HN: Wat – Deep inspection of Python objects
on Friday July 26, 2024 @05:34AM (#41077140)
Thank you all, I learned from you that it's possible to have a callable module. Although `sys.modules[__name__] = wat` looks like a black magic and I'm a bit afraid of locking out to other importable things in this package, I think I'll go for it.
Re:Show HN: Wat – Deep inspection of Python objects
on Thursday July 25, 2024 @06:27PM (#41074073)
"import wat" would be great, but Python has some restrictions about modules not being callable. That's why I ended up with longer `from wat import wat`. Not sure but maybe this would be more convenient `import wat; wat.wat / object`
Re:Show HN: Wat – Deep inspection of Python objects
on Thursday July 25, 2024 @06:11PM (#41073921)
You're completely right. `dir()` does the same in terms of functionality. In fact, my tool makes use of `dir` under the hood. I just wanted to make it more readable, and to combine `dir`, `type`, `repr`, `len`, `inspect`, etc. into one easily accessible place.
Re:Show HN: Wat – Deep inspection of Python objects
on Thursday July 25, 2024 @05:56PM (#41073806)
Yes, that has the same effect as installing the package. So if you feel uncomfortable, you can either install the pip package (and of course review the installed code) or review the decoded string before executing it. It's not that obfuscated anyways, it's still quite readable.
Re:Show HN: Wat – Deep inspection of Python objects
on Thursday July 25, 2024 @05:50PM (#41073762)
It's the parentheses that drove me crazy. As people already noted, it's for faster typing, at the cost of the division magic as you noted. If it's more familiar to you, it works with `wat(object)` syntax as well.
Show HN: Wat – Deep inspection of Python objects
fpick – Interactive File Picker
Re:fpick – Interactive File Picker
on Monday February 05, 2024 @05:26AM (#39259492)
Interactive file picker to traverse through directories tree in a terminal
Re:Regex-rename – Bulk rename tool
on Monday August 14, 2023 @06:36AM (#37119429)
Bulk rename tool based on regular expressions to rename multiple files at once.