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: https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement
Here's my #Limerick about some bad career advice I received back in the '70s. Fortunately, I ignored it.
(I'm using the #MicroPrompt #Assert.)
"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!"
#Career #Law #Lawyers #Advice #Limericks #Rhyme #Poetry #TinyPoems #SmallPoems #Poets #Prompts #Prompt #WritingPrompt #Poem #AmWriting #MicroPoetry #Writing #WritingCommunity #PoetryCommunity
#poetrycommunity #writingcommunity #writing #micropoetry #amwriting #poem #writingprompt #prompt #prompts #poets #smallpoems #tinypoems #poetry #rhyme #limericks #advice #lawyers #law #career #assert #microprompt #limerick
The acting #director of the #African #NovaScotia #Justice Institute says #federal #funding for the institute will go toward #programming to help #Black people in Nova Scotia better #understand & #assert their #rights .
On Wednesday, the federal #DepartmentOfJustice announced it will spend $607,000 over three years for a Justice #Partnership & #Innovation Program.
https://www.pentictonherald.ca/spare_news/article_499418af-11be-58d6-982b-7a9b5175da4a.html
#decolonization #HumanRights #LegalRights #BlackCanadians #Maritimes #Canada #GoodNews #CanadaLegal #Legal
#director #african #novascotia #justice #federal #funding #programming #black #understand #assert #rights #departmentofjustice #partnership #innovation #decolonization #humanrights #legalrights #blackcanadians #Maritimes #canada #goodnews #canadalegal #legal
#NippiAlbright said the #IndigenousWomensCollective took a stand to start #CallingOut those who #falsify #Indigenous #identity . The #Indigenous #Womens #Collective are a group of Indigenous women who aim to #protect & #voice the #rights & #injustices of #IndigenousWomen .
In a tweet, the Indigenous Women’s Collective stated they #assert that Indigenous #IdentityTheft is an act of #colonial violence.
https://globalnews.ca/news/9548230/push-saskatchewan-employers-verify-indigenous-claims/amp/
#nippialbright #indigenouswomenscollective #callingOut #falsify #indigenous #identity #womens #collective #protect #voice #rights #injustices #indigenouswomen #assert #identitytheft #colonial #saskatchewan #pretendians #canada
I've noticed that #rustlang examples meaje frequent use of #assert 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 #rustlang than other languages or perhaps I'm woefully out of date abd they are common place everywhere these days.
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.
#python #pyodide #parsons #assert
🐦🔗: https://twitter.com/codepuzzledotio/status/1596528649846812677
#python #pyodide #parsons #assert
@b0rk I use #assert a lot for all sorts of pre- and postconditions. Also useful for checking that code is on the correct dispatch queue in #SwiftLang: