-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help @beartype help numerary #7
Comments
Diversionary trainwreck alert: you have implemented something suspiciously fast and dangerously beautiful with the homegrown private caching protocol API (HPCPAPI) that is the beating heart of Here is what I am cogitating. There's a caveat. If caching dramatically increases space complexity for downstream consumers in unexpected ways, the userbase will abandon @beartype after doxxing me on 4chan. That's bad. You've probably already tackled this concern (...maybe with an internal LRU cache?). If so, I have no remaining concerns and (with your generous permission and all the glory attributed directly to you as I abase myself before your complex throne of head-spinning protocols) will shortly assimilate your HPCPAPI into |
SUBSTANTIAL EDIT WARNING: My prior comment(s) responsive to #7 (comment) have been migrated to #8 (comment). Yes, even with the prominent "diversionary trainwreck alert" I still could not stop myself from focusing on the shiny object. Cleaning up the debris now, and keeping this on track in the spirit of the OP, which I am still digesting…. But, before I forget:
|
Oh! I may have misread your #7 (comment) as a true diversion to the original post rather than a supplement to it. FWIW, I have do have thoughts on this. There are pitfalls and asymmetries (as I'm sure will come as no shock to you), but we can dig into those gritty details and see if I can be of any help to beartype at any layer. Buuut… to get to the heart of one of your |
SUBSTANTIAL EDIT WARNING: Additional discussion topics moved to #8, since I now understand this issue is about a FAQ entry. |
Regarding a FAQ entry, I like it. Thought: Maybe we should see where #8 and beartype/beartype#86 takes us first, and then figure out what (if any) messaging around |
Actually, let's temporarily set aside this whole help @beartype help Why? Because I have a more pertinent question first:
You're the first I've asked and likely to be the first I ever ask1, because my fundamental position on the rabble at the gates is: "Smile widely first. Sic Main Coon cat with frothing mouth foam later." 1. Within the expected lifetime of my wheezing 10-year-old desktop that even Gentoo Linux now looks askance at with arms akimbo, a Fry squint, and the log statement "This is fine." repeated 42 times in its startup Your spate of high-velocity, hard-hitting, roundhouse-kicking pull requests both here and against friggin' CPython itself have confirmed deep-seated suspicions that you and you alone hold the unthinkable power of Greyskull. Also, I now consider you a GHBFFL. We see eye-to-eye. ←zomg don't click that suspicious link at work i'm dying with laughter here as the cat's staring me down Should you choose to accept this impossible mission, I'd just like to reassure everyone in the waiting room that this might even be painless. You shouldn't feel a thing aside from the expected eruption of bedsores. You don't have to actually do anything, either. All I ask is that, if you have anything plus-sized and/or questionable to commit, you reluctantly route your changeset through the PR workflow so that Spen can capably dissect it with his disconcertingly self-aware neural net first. Should you choose to reject this impossible mission (...because impossible), I'd also like to reassure everyone that this offer is available for an unlimited time should you ever reconsider. Lastly, whatever you choose, thanks so much for everything you've already done. I really appreciate the effusive outpouring of support – and so will @beartype's vast and amoeba-like userbase after I finally do something and drop the This bear emoji's for you. 🧔 |
I am humbled and touched. I accept your terms and will honor and respect the intent with which they are offered. I solemnly pinky swear to tread if not lightly then at least respectfully and in the spirit of the Ursine Creator. ❤️ Love the bear emoji and am now debating whether to intentionally grow back my beard.¹ (It happens accidentally all the time.) Also, I am stealing the term "GHBFFL". And thank you (for some definition of "thank you" 🤣) for that video. (The whole duet-with-oneself-in-chromatically-opposing-suits thing was a nice touch.) I am glad (for some definition of "glad") that I made the extra effort to look up the lyrics. (Worth it, and not just for the superfluous apostrophes!) Rest assured, that one's making the rounds. 😏 ¹ As I'm sure you'll appreciate, the wife has veto power, and properly so. |
Wondrous day. Your posh invitation has now been shipped and should arrive shortly by bearded gnome carrier to an e-mail inbox adjacent to you. Because I should never be let anywhere near administrative access controls, I've elected to add you as a full-blown member of the @beartype organization. Oh, yes. It's happening. I'm mostly unclear as to the distinction between GitHub members and outside collaborators. Luckily, so is everyone else. Once you accept the holy sacrament of the Bear Clan and are fully vested as a bearded bear bro, the incorrigible GitHub UI suggests:
zomg this cannot be
My glorious spectrum eye's see your stylish excellent human's eye's and raise you substantial precise eye's. |
✋😔 I solemnly swear not to manipulate any GH administrative primitives without first securing your informed consent.¹ As an aside, I think GH "Teams" are kind of like user groups, so you probably don't need to consider them until you amass a threshold number of professionals keeping the Beartype Ecosystem humming in full force, including future synergistic endeavors I know you can't wait to tackle, like the Beartype Whatsapp Plugin, the BearCoin eCommerce Marketplace Solutions Network, the Beartype Marketing Insights Platform, the Beartype Workflow Management Engine, and the entire Bear2Bear Collaborative Logistics Facilitation Product Suite and related Consulting Services. But for now, yeah, GH Teams are probably best left to the side as an unnecessary complication. ¹ "But wait, Matt, isn't all consent informed? I mean how can you consent to something without understanding what you're consenting to? Isn't that the primary pillar behind establishing an 'age of consent', namely that young persons lack capacity to understand what they're getting into?" Sadly, the legal standard for consent in many situations does not mean that one is actually informed, just that one has the opportunity to have been informed. In practice, this means you can easily nudge someone into legally consenting really, really easily without them ever understanding it until it's too late. Yay. 😒 So, no. The "informed" is tragically not redundant, but it is the standard I will strive for in this relationship. 😊 |
You may now caper with glee. Ursula Horribilis, the munificent bear deity of the North ("Praise be to Her Bloody Muzzle."), has now granted you direct write access to the main
I sense a man so hip-deep in Enterprise-Grade DevOps Solution Stacks that he now thinks in capital letters. Also, I guffawed continuously – much to the dismay of our insomniac Main Coon that insistently watches me pound sand into random keyboard keys all evening in the hopes of divining a causal motive behind her master's madness. You'll never understand me, elongated furball with claws! Never! Lastly, "Bear2Bear." Srsly. "Bear2Bear," people. B2B's right out. That only leaves Be2Be as our marketable trending buzzword. I already feel the looming TED talks. They're crawling up my red and sweaty neck like so many susurrating beetles, chittering as they feast on the very fabric that sustains me. Welp, that intensified fast.
You're depressing me over here. This is like every upvoted thread on /r/OffMyChest, except I've never heard of that subreddit and would absolutely never, ever frequent it even if I had. I can only surmise that the current top thread there might have a title that reads:
Informed consent: where were you when we needed you? |
@posita: I summon thee with a flourish of my wand (AKA, a half-rotted knobbly branch I found outside and now call "Ron Stickamy"). To no one's surprise, I never did author the FAQ entry imagined above. Nonetheless, I have unrelated questions for you:
Lastly, hope you're doin' awesome! Late-stage capitalism is the endless grind I wish I could free all humans from. Sadly, we all labour in quietude and make our fitful peace with moneyed interests as best we can. Despite that, I hope you and your family are enjoying a warm yet fun winter. Wherever life may find you, grasp it by the 2D6 and roll! 🎲 🎲 |
@leycec, please accept my apologies for my inability to prioritize anything beyond the basic staples of family life. Better late than never¹, right? Although, upon reflection, given the gravity of the request, you and beartype deserved better. I am a bad mother, but I am learning to be good. Regarding your first request, I am totally cool with Now that we've dispensed with the easy part—and speaking of open and honest discussions—I turn to your second (and more sober) request. Let me start by acknowledging it for the honor it is. I am sincerely humbled by it. (And, quite frankly, inspired to try to live up to the ideal gathered in your view of me.) Before I accept, I'd like to know more. Assuming it's not too invasive, perhaps we could do that in a more personal setting? Maybe via ZoomFace or TeleSignal or whatever the kids use these days, or maybe just a good old fashioned phone call? ¹ Not legal advice. Important exceptions apply, like drinking spoiled milk or getting stabbed. Please apply common sense or consult an adult to help you if you are unsure. |
🥳 When you find a precious spare moment in between meaningful family interactions that will sculpt and mould the brightest child minds of the 21st Century into the future saviours of our race, it'd be super-swell if you could follow these six simple doomsday instructions to transfer I solemnly promise to immediately appoint you sole maintainer and proprietor of the newly transferred
Fantastic! That's perfect, because you just synopsized the @beartype Way: pretend you're fixing something that can't actually be fixed, but do it quietly and cleverly enough so that nobody notices the actual difference. After all, everything in Python is really just legerdemain, prestidigitation, smoke, mirrors, and five elephants on the back of a giant snake. There's very little that's actually built into the language itself. The core language is really just a small handful of types implemented in C purely for efficiency reasons. Unsurprisingly, those types don't work particularly well. They don't scale. They're still too slow, despite being implemented in C. They mostly can't even be subclassed or weakly referenced. The entire field of AI is built on the back of ignoring those types by replacing them with third-party stand-ins that actually do work like NumPy, SymPy, JAX, and [ insert API-of-the-Day here, ChatGPT! ]. The prior paragraph now means that CPython devs are raising GoFundMe funds to raze @leycec's cottage into a charnal pool of ash and tear-stained cinders. Do it, CPython devs! The insurance payout only feeds @beartype and makes it stronger. But my unsubstantiated point that is almost certainly wrong still stands. The 99.99% of Python that is not hardcoded at the C layer (i.e., what everyone thinks of as "Python") is obfuscatory and non-trivial hand-waving to usefully generate the illusion of a working programming language. That's all keyboard jockeys like us ever trade in: illusions. That's all @beartype is, too: we can't actually perform full-blown linear-time @beartype invites
You're too humble. I love that. Since I myself lack this trait, your humility humbles and then shames me. Deep down, however, your subconscious self that awakens only during lucid dreaming, astral projection, and remote viewing ...just kidding! ...totally not kidding to solve everything you suffered through in the prior day suspects that your work is actually phenomenal. @beartype invites you to accept that this is the case.
Knowledge is a good idea. Sadly, I too am ignorant. I think GitHub inheritorship means that GitHub would automatically assign you ownership over my @leycec account on my untimely demise. (There may be a perverse incentive there.) Thankfully, that's probably two decades away... probably. My wife's a published biophysicist. I blindly obey the scientific protocol she developed after trawling through reams of unreadable and extremely boring peer-reviewed metastudies on my behalf. In return, I continue living. I feel that this is a fair trade. Smiley cat agrees. You'd better, smiley cat! 😸
Childhood flashback intensifies. |
'Tis done. I probably need your help setting up collaborator permissions, secrets, etc., but ✊🐻 |
So proud of all you've accomplished. I've immediately escalated you to Administrator! As a thunderous roar fills the pungent air, you have regained all the powers you once had. Ravens caw; trees tremble; fissures open; the Earth herself groans tremulously; mystical energy cascades through the fey leylines of the Old Ways. Arise,
I'll publicly push
Press F for FAQRelatedly, @beartype now actually has a real ReadTheDocs-hosted documentation site. I've finally sucked the venom out of the rattlesnake! Sphinx hurts, but surely the pain will end soon. If you ever find a spare minute lying around somewhere, it would be wondrous if you could doctor up a new FAQ entry synopsizing how to type-check scalar numerics. It's non-trivial stuff and you are the domain expert I defer to. Something like:
I'm desperate. Don't worry about a PR, unless you really want to. Throw the text up anywhere and I'll giddily use it. I'll take anything: Markdown, MyST, reStructuredText (rST), lewd ASCII art. You name it! If it's ASCII art, please feature a bear rolling dice. This is all I ask. |
Greetings and salacious salutations, fellow wayward traveller on the congested superhighway of questionable human experience. Per beartype/beartype#84, I'd love to promote numeric health in downstream code by elevating
numerary
above lesser and baser alternatives for type-checking numbers with @beartype.Python numbers are a fathomless well of squalid darkness. I need you to man the lonely walls with me. I have no idea what I do. You do. Together, let us bring light to the dank codebases that think accepting a
bool
as anint
is good API practice.Consider this hypothetical FAQ entry with your keen hawk eye:
How do I type-check numbers...?
"Numbers" means many things to many people. Some people think booleans are numbers. Technically, these people are not wrong. Pragmatically, these people are wrong. Don't hire these people.
Stop! Disambiguate and listen. You really want to type-check...
...builtin numeric types covariantly?
You want to type-check
int
,float
, orcomplex
numbers including instances of subclasses of those types? O frabjous day! This is the trivial case, becausebeartype
already does exactly what you want out-of-the-box.Just annotate with any builtin numeric type as is: e.g.,
Be forewarned that any
bool
is also anint
and thus satisfies the above API. If you don't want that, spoiler alert: you don't want that the next question is your codebase's BFFL....builtin numeric types invariantly?
Something, something, something. I got exhausted and fell down onto the bed in a dishevelled heap here. This is the toll that type-checking numbers takes on the unprepared body, @posita.
Don't let this happen to you.
The text was updated successfully, but these errors were encountered: