[{"data":1,"prerenderedAt":510},["ShallowReactive",2],{"project-41070428":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":29,"sentiment":30,"stance_mix":31,"scored_comments":36,"aspects":37,"strip":46,"post_text":48,"what":49,"said":86,"maker_in_thread":214,"shape":223,"grid":227,"attempts":473,"same_week":474,"maker_shows":34,"maker_hidden":502,"reader_version":503,"card":504},"41070428","Wat","Deep inspection of Python objects","title","Show HN: Wat – Deep inspection of Python objects","https:\u002F\u002Fgithub.com\u002Figrek51\u002Fwat","github.com","igrek51",1721924314,2024,393,92,118,3515,4,"legend","dev_tools","python object inspector","library",[24,25,26,27,28],"python","object inspection","debugging","repl","introspection","mixed",0.187,{"positive":32,"neutral":33,"mixed":34,"critical":35},17,26,1,10,54,{"idea":38,"design":41,"docs":43,"privacy":45},{"positive":39,"critical":40},6,3,{"positive":42,"critical":42},2,{"positive":44,"critical":44},0,{"positive":34,"critical":40},[47,47,44,40,47,40,44,40,40,44,34,47,47,47,44,44,47,47,47,47,47,47,34,34,40,40,34,40,34,34,40,47,40,40,40,40,40,47,47,47],5,null,{"problem":50,"audience":61,"pricing":48,"motivation":73,"time_to_build":48,"stack":77,"openness":85,"stage":85,"team_size":85},{"value":51,"source":52,"evidence":53},"Inspecting Python objects is hard with dir, help and repr; wat gives a quick readable overview","maker",[54,57],{"id":55,"by":11,"text":56},"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…",{"id":58,"by":59,"text":60},"41076163","agumonkey","help says too much, usually you'd like a quick overview slightly formatted and well classified, which is what wat seems to afford here",{"value":62,"source":63,"evidence":64},"Python developers debugging in interactive sessions","inferred",[65,69],{"id":66,"by":67,"text":68},"41073209","skeledrew","Waaat :D. This is so nice. I used to use python-ls[0] for similar, but something about it that I can't recall broke for me and it's no longer maintained. Adding to my debugging…",{"id":70,"by":71,"text":72},"41071630","AcerbicZero","Wow, this is the kind of tool that would have been a game changer when I was learning python; being able to see what is happening under the covers is part of the critical path…",{"value":74,"source":52,"evidence":75},"Combine dir, type, repr, len and inspect into one easily accessible place",[76],{"id":55,"by":11,"text":56},[78],{"value":79,"source":63,"evidence":80},"Python",[81],{"id":82,"by":83,"text":84},"41072878","fuzztester","the author is using the Python inspect module of the stdlib under the hood to provide the functionality, of course with a lot of value-add. see inspection.py in the wat module.…","unknown",{"praise":87,"objections":113,"requests":144,"questions":160,"alternatives":175},[88,94,102],{"value":89,"source":90,"evidence":91},"Useful, quick overview compared to help() and dir()","commenter",[92,93],{"id":58,"by":59,"text":60},{"id":66,"by":67,"text":68},{"value":95,"source":90,"evidence":96},"Clever base64 insta-load snippet",[97,101],{"id":98,"by":99,"text":100},"41106365","nikvdp","> If you want to quickly debug something, you can use this inspector without installing anything, in the same session. > Load it on the fly by pasting this snippet to your Python…",{"id":66,"by":67,"text":68},{"value":103,"source":90,"evidence":104},"Short no-parentheses syntax is handy in a REPL",[105,109],{"id":106,"by":107,"text":108},"41071570","enragedcacti","I think it makes a lot of sense in the context of a live interpreter. Wrapping and object in help() or dir() is an annoying set of movements vs. just pressing 5 keys with no…",{"id":110,"by":111,"text":112},"41075636","wnolens","I love it",[114,129],{"value":115,"source":90,"evidence":116},"Base64 insta-load of executable code is a security concern",[117,121,125],{"id":118,"by":119,"text":120},"41072579","wantsanagent","Re: Insta-load Please don't do this. Exec'ing arbitrary, obfuscated code you just copied from the internet directly in a running environment is such a bad idea it shouldn't even…",{"id":122,"by":123,"text":124},"41071788","Aeveus","Looks like a great tool. Will start playing with it whenever I have to dive into an existing project again. One thing I'd like to note, though, is that most engineers (at least…",{"id":126,"by":127,"text":128},"41079963","jampekka","Pip install allows arbitrary code execution.",{"value":130,"source":90,"evidence":131},"Overloading the division operator is an odd choice",[132,136,140],{"id":133,"by":134,"text":135},"41079793","heyts","This looks super useful, but I was wondering if I'm the only one bothered by this recent trend of overloading completely unrelated operators (here the `\u002F` operator) in the name…",{"id":137,"by":138,"text":139},"41071446","languagehacker","This is interesting. I'm wondering what compelled the author to use the division magic method for arguments instead of the more intuitive and commonly used approach to passing…",{"id":141,"by":142,"text":143},"41075013","jawns","I get the reasoning behind it, but the choice of the division operator is still a little weird. I believe it should be equally possible to overload the bitwise OR operator (|),…",[145,152],{"value":146,"source":90,"evidence":147},"Allow plain import wat with identical usage",[148],{"id":149,"by":150,"text":151},"41073881","enriquto","> from wat import wat Given the cool nature of this project, I'm surprised they don't offer simply \"import wat\" with identical usage syntax. Thus inviting curious users to…",{"value":153,"source":90,"evidence":154},"Jupyter widget for object exploration",[155,156],{"id":66,"by":67,"text":68},{"id":157,"by":158,"text":159},"41071198","blackbear_","Looks great! And it would make for a great addition to Jupyter lab. I actually can't believe there is still no decent variable explorer bundled in",[161,169],{"value":162,"source":90,"evidence":163},"Why use division operator instead of a function call",[164,168],{"id":165,"by":166,"text":167},"41072813","Retr0id","I'm normally a big fan of python operator overload hacks, but why are we doing `wat \u002F foo` instead of just `wat(foo)` ?",{"id":137,"by":138,"text":139},{"value":170,"source":90,"evidence":171},"Does the insta-load snippet run the same code as installing the package",[172],{"id":173,"by":83,"text":174},"41072201","just so that it is clear for everyone, including newbies here, does the insta-load code snippet work like this: the author has encoded the wat module's source code into base64.…",[176,183,190,200,207],{"value":177,"source":90,"evidence":178},"icecream",[179],{"id":180,"by":181,"text":182},"41074472","bobuk","Looks like a fancy version of good old icecream. https:\u002F\u002Fgithub.com\u002Fgruns\u002Ficecream If you never heard about it, scroll to the bottom to…",{"value":184,"source":90,"evidence":185},"rich.inspect",[186],{"id":187,"by":188,"text":189},"41072208","blueboo","rich.inspect has been my go-to for this. Comes pre-installed in a vanilla Colab kernel too",{"value":191,"source":90,"evidence":192},"dir and help built-ins",[193,197],{"id":194,"by":195,"text":196},"41072519","alkh","It important to remind everyone that you can already do something similar via the build-in function help(). For example, if I run help({1}) I get the documentation for a set,…",{"id":198,"by":83,"text":199},"41072812","and the dir() built-in Python function.",{"value":201,"source":90,"evidence":202},"snoop",[203,206],{"id":204,"by":67,"text":205},"41076480","See snoop[0], which does just this. It also has an install function that registers it in builtins, making it universally available. [0] https:\u002F\u002Fpypi.org\u002Fproject\u002Fsnoop\u002F",{"id":66,"by":67,"text":68},{"value":208,"source":90,"evidence":209},"q module",[210],{"id":211,"by":212,"text":213},"41074451","scrollaway","Check out the module “q”! It’s callable, its author talked about how great it would be to have a module level __call__ because the way it was made callable is super wonky.",{"comments":39,"answered":34,"key":215},[216,219,222],{"id":217,"text":218},"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…",{"id":220,"text":221},"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…",{"id":55,"text":56},{"commenters":224,"max_depth":47,"maker_replies":39,"first_comment_mins":225,"lifespan_hours":226},68,73,131,[228,230,234,237,241,245,248,251,254,256,259,262,264,266,270,273,275,276,278,281,284,286,287,290,292,295,298,301,303,306,308,310,311,314,318,321,323,327,329,331,334,338,340,344,347,349,353,356,359,363,367,370,374,377,379,382,384,387,389,391,392,396,399,403,406,410,413,414,417,418,420,423,424,426,429,432,433,436,439,441,444,447,451,454,455,457,460,462,465,467,470,472],[66,44,47,229,67,44],"project\u002Fpositive\u002Fnone",[231,44,44,232,233,44],"41075248","other\u002Fneutral\u002Fnone","randomfool",[235,44,44,232,236,44],"41080581","nyoomboom",[238,34,47,239,240,44],"41073002","project\u002Fpositive\u002Fidea","benrutter",[242,34,44,243,244,44],"41074154","other\u002Fneutral\u002Fdocs","pjot",[246,34,44,243,247,44],"41077698","notpushkin",[249,34,44,243,250,44],"41078718","shabble",[252,34,44,232,253,44],"41080214","hughesjj",[180,42,40,255,181,44],"project\u002Fneutral\u002Fidea",[257,42,44,232,258,44],"41074604","creichenbach",[260,40,47,229,261,44],"41076469","fermigier",[149,18,40,263,150,44],"project\u002Fneutral\u002Fdesign",[217,18,44,265,11,34],"maker\u002Fneutral\u002Fdesign",[267,18,44,268,269,44],"41074406","commenter\u002Fneutral\u002Fnone","Rhapso",[271,18,44,268,272,44],"41074753","skitter",[274,18,44,268,269,44],"41074936",[211,18,40,263,212,44],[277,18,44,268,150,44],"41076936",[279,18,40,263,280,44],"41074724","hprotagonist",[282,18,44,232,283,44],"41075275","jkrubin",[204,18,44,285,67,44],"other\u002Fneutral\u002Fdesign",[220,18,44,265,11,34],[288,18,44,289,247,44],"41077751","commenter\u002Fneutral\u002Fdesign",[133,47,34,291,134,44],"project\u002Fcritical\u002Fdesign",[293,47,34,291,294,44],"41080064","wrboyce",[296,39,40,263,297,44],"41077204","098799",[299,39,47,229,300,44],"41077632","BiteCode_dev",[70,302,47,239,71,44],7,[82,304,40,305,83,44],8,"project\u002Fneutral\u002Fnone",[307,304,44,243,83,44],"41083020",[98,309,47,239,99,44],9,[187,35,44,232,188,44],[312,35,44,232,313,44],"41075191","emmanueloga_",[315,316,44,232,317,44],"41074144",11,"ilyagr",[319,316,44,232,320,44],"41077360","nython",[322,316,44,232,317,44],"41085018",[324,325,47,239,326,44],"41076070",12,"lofaszvanitt",[328,325,44,268,83,44],"41083000",[330,325,44,268,326,44],"41096387",[332,325,44,333,83,44],"41116132","commenter\u002Fneutral\u002Fdocs",[335,336,47,229,337,44],"41072516",13,"chis",[157,339,47,229,158,44],14,[341,342,44,232,343,44],"41076687",15,"revskill",[345,342,44,232,346,44],"41077777","CornCobs",[348,342,44,268,127,44],"41079912",[350,351,47,239,352,44],"41076614",16,"ur-whale",[354,351,40,355,83,44],"41083075","project\u002Fneutral\u002Fdocs",[357,32,47,229,358,44],"41075627","frays",[360,361,47,229,362,44],"41081876",18,"kseistrup",[364,365,40,305,366,44],"41073541",19,"maxmcd",[118,368,34,369,119,44],20,"project\u002Fcritical\u002Fprivacy",[371,368,34,372,373,44],"41072585","project\u002Fcritical\u002Fnone","tantalor",[375,368,34,372,376,44],"41073160","timdorr",[378,368,40,305,67,44],"41073534",[380,368,44,268,381,44],"41074677","SOLAR_FIELDS",[383,368,44,232,127,44],"41079939",[385,368,40,305,386,44],"41074791","etbebl",[388,368,40,305,67,44],"41075293",[390,368,40,305,346,44],"41077782",[126,368,34,369,127,44],[393,368,44,394,395,44],"41073446","commenter\u002Fneutral\u002Fprivacy","oreilles",[397,368,44,394,398,44],"41078127","__MatrixMan__",[400,368,40,401,402,44],"41074458","project\u002Fneutral\u002Fprivacy","slt2021",[404,368,40,401,405,44],"41077555","erinaceousjones",[407,408,44,232,409,44],"41072242",21,"timhh",[194,411,34,412,195,44],22,"project\u002Fcritical\u002Fidea",[198,411,34,412,83,44],[415,411,34,412,416,44],"41073113","guruparan18",[55,411,44,255,11,34],[419,411,40,355,83,44],"41075880",[421,411,40,255,422,44],"41074933","orbisvicis",[58,411,47,239,59,44],[165,425,40,263,166,44],23,[427,425,40,263,428,44],"41073143","JulianChastain",[430,425,40,263,431,44],"41073961","contravariant",[141,425,40,263,142,44],[434,425,44,289,435,44],"41075967","Tomte",[437,425,40,263,438,44],"41077186","auscompgeek",[440,425,44,263,11,34],"41077523",[122,442,40,443,123,44],24,"project\u002Fmixed\u002Fprivacy",[445,442,34,369,446,44],"41071916","kajecounterhack",[448,442,47,449,450,44],"41071934","project\u002Fpositive\u002Fprivacy","Spivak",[452,442,40,401,453,44],"41071966","tacoooooooo",[173,442,40,401,83,44],[456,442,44,401,11,34],"41073806",[458,442,47,459,83,44],"41074778","maker\u002Fpositive\u002Fnone",[137,461,40,263,138,44],25,[463,461,40,263,464,44],"41071554","lakshayg",[106,461,47,466,107,44],"project\u002Fpositive\u002Fdesign",[468,461,40,263,469,44],"41072422","pvg",[471,461,44,263,11,34],"41073762",[110,461,47,466,111,44],[],[475,479,483,488,493,497],{"id":476,"name":477,"points":478,"category":20},"41068719","Haystack",546,{"id":480,"name":481,"points":482,"category":20},"41088273","Semantic Grep",356,{"id":484,"name":485,"points":486,"category":487},"41086620","Opslane",319,"infrastructure",{"id":489,"name":490,"points":491,"category":492},"41105130","embedding.io",305,"ai",{"id":494,"name":495,"points":496,"category":20},"41080189","gg",205,{"id":498,"name":499,"points":500,"category":501},"41095839","statsbomb-3d-viz",182,"creative",false,"v2",{"id":505,"name":5,"line":6,"ai":502,"cat":20,"year":13,"points":14,"comments":15,"rec":29,"s":506,"top":18,"kw":507,"maker":11,"domain":10,"tier":19,"attempts":44,"strip":508,"url":9,"mix":509,"praise":89,"objection":115,"sub":21},41070428,0.19,[24,25,26,27,28],"5503530330155500555555113313113533333555",[32,33,34,35],1793991096590]