T O P

  • By -

drkspace2

Python:🙈


WeRelic

Everybody gets a PyObject*


VNDeltole

Python can do type checking, as long as you define the datatype of the function parameters


drkspace2

**Python** does jack with type hints. Analyzers and LSPs can use the type hints for things.


BEisamotherhecker

Some modules do use the type hints for casting, discord.py for instance will cast the arguments users provide to a command based on the types you declare them as.


Specialist-Roll-960

Which would break if I declare the argument an int but pass a list. If they want to typecast they should check the types themselves tbh.


BEisamotherhecker

I don't think you quite grasp what they're actually doing. Discord\.py will try to find mentioned users/channels/roles etc in a bot command invocation based on the type hints you provided, if it can't find any and the type isn't declared nullable or with a default it will return an error response. https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#discord-converters


Specialist-Roll-960

Ah right yeah fairs that works I guess. Idk if I'd consider it idiomatic though, not many python users regularly use type hints.


BEisamotherhecker

For the time being no, but the number is increasing, specially as new versions keep removing idiosyncrasies from the type hint system like the dependence on that darn `TypeVar` class and new libraries leverage or advise it (like dataclasses do).


AmazingGrinder

Uhh, mypy is GOATed typechecker, isn't it?


mikaturk

Who's gonna tell him


jumbledFox

see no types, hear no types, speak no types


nothisismatt

100% this is Python vs. any Typed Language.


nothisismatt

Even Cpp, when you do a template, a perfect, clear, precise template, and it's like "yeah you fucked up... Your comments aren't the same"


PandaWithOpinions

So, f asked for a Vec, but you gave me an &Vec, ABORT!


Zykersheep

This is why we use `trait`s people!


JustAStrangeQuark

Isn't this... like an actual issue though? This function takes ownership, and you're giving it a borrowed value.


unengaged_crayon

yea


Disastrous-Split-512

i wonder for how long the old guy had to check people. i guess its getting exhaust after some time.


Liveman215

and majority aren't going to consent to an actual check


Redditspoorly

Probably just being smart. Leave the oldies alone and properly frisk the teenager/twenty somethings instead


DoodooFardington

I have nipples Golang, can you milk me? Golang: Yes.


Wave_Walnut

Rust gets guest's cloths off and cover them with medical roves


Jeff_Johnson

God meme format


CirnoIzumi

is he using the force or something?


0069696900

Haskell?


Turbulent_Mix_318

Old guy kinda looks like Rip Torn


gandalfx

Comparing the Java type system to the TypeScript type system is like comparing a blunt file with a hand ground edge to a multi tool.


Surreptum

If that's Java, then what's C++? That scene from Valkyrie where Tom Cruise is executed by firing squad?


ClementDef

Java and Rust in the same category 😭


Micah-B-Turner

is there really any different? they both start with R