· @multimeric
358 followers · 382 posts · Server genomic.social

Python's assert is in a very awkward position.

It's a concise keyword for a very common type of validation, but it gets ignored if Python is run in optimised mode. However no one really runs Python in optimised mode so there are arguments on both sides about whether or not you should use assert.

Personally I also dislike that it always throws an AssertionError, so you can't use custom error types for the sake of user friendliness.

More info: docs.python.org/3/reference/si

#python #assert

Last updated 1 year ago

Madeleine Begun Kane · @MadKane
829 followers · 1302 posts · Server mas.to

Here's my about some bad career advice I received back in the '70s. Fortunately, I ignored it.
(I'm using the .)

"You aren't assertive enough,"
Warned a lawyer. "You need to be tough
To make it in law.
You've a terrible flaw,
So nix law school. You lack the right stuff!"

#poetrycommunity #writingcommunity #writing #micropoetry #amwriting #poem #writingprompt #prompt #prompts #poets #smallpoems #tinypoems #poetry #rhyme #limericks #advice #lawyers #law #career #assert #microprompt #limerick

Last updated 1 year ago

PhoenixSerenity · @msquebanh
1305 followers · 12580 posts · Server mastodon.sdf.org
PhoenixSerenity · @msquebanh
1306 followers · 12506 posts · Server mastodon.sdf.org
Andy · @ely_peddler
99 followers · 1039 posts · Server hachyderm.io

I've noticed that examples meaje frequent use of as a means of saying what the result of a piece of code would be, which is quite neat. I'm used to using assert in tests. What I can't fathom is whether they are used more liberally in than other languages or perhaps I'm woefully out of date abd they are common place everywhere these days.

#rustlang #assert

Last updated 1 year ago

Greg Kemp · @gkemp
34 followers · 75 posts · Server hachyderm.io

Dumb assertions in my code (cycle >= start_cycle) found a bug in a function return type. Give it up for assertions! ++

#assert #c

Last updated 2 years ago

Greg Kemp · @gkemp
73 followers · 152 posts · Server hachyderm.io

Dumb assertions in my code (cycle >= start_cycle) found a bug in a function return type. Give it up for assertions! ++

#assert #c

Last updated 2 years ago

RT @codepuzzledotio@twitter.com

Prochaine évolution de Code Puzzle: puzzles avec vérification du code grâce à @pyodide@twitter.com et des jeux de tests.

➡️ codepuzzle.io

🐦🔗: twitter.com/codepuzzledotio/st

#python #pyodide #parsons #assert

Last updated 2 years ago

Helge Heß · @helge
370 followers · 248 posts · Server mastodon.social

@b0rk I use a lot for all sorts of pre- and postconditions. Also useful for checking that code is on the correct dispatch queue in :

#assert #swiftlang

Last updated 2 years ago

Kévin Dunglas · @dunglas
949 followers · 5179 posts · Server mastodon.social

RT @webmozart
To all users of my PHP libraries: I'm in the process of moving them to our company account and designating maintainers so that development can continue. If you want to help, please reach out to me.

#glob #assert #php

Last updated 4 years ago