About 362,000 results
Open links in new tab
  1. python - Match case statement with multiple 'or' conditions in each ...

    Dec 2, 2022 · Match case statement with multiple 'or' conditions in each case Asked 3 years ago Modified 1 year, 3 months ago Viewed 38k times

  2. What is the Python equivalent for a case/switch statement?

    Jul 14, 2012 · Python 3.10.0 provides an official syntactic equivalent, making the submitted answers not the optimal solutions anymore! In this SO post I try to cover everything you might want to know about …

  3. How to do an else (default) in match-case? - Stack Overflow

    Aug 16, 2021 · 79 Python recently has released match-case in version 3.10. The question is how can we do a default case in Python? I can do if/elif but don't know how to do else. Below is the code:

  4. Como funciona o pattern matching estrutural (declaração match) em …

    Mar 2, 2021 · Recentemente, o pattern matching estrutural foi introduzido versão 3.10 do Python. Para isso, foram introduzidas as palavras-chave match e case. Foram, nas notas de release, incluídos …

  5. python - How to use values stored in variables as case patterns ...

    I'm trying to understand the new structural pattern matching syntax in Python 3.10. I understand that it is possible to match on literal values like this: def handle (retcode): match retcode: ...

  6. Python: match/case by type of value - Stack Overflow

    May 18, 2022 · I came across a weird issue while using the new match/case syntax in Python3.10. The following example seems like it should work, but throws an error: values = [ 1, "hello", T...

  7. How to do structural pattern matching in Python 3.10 with a type to …

    Jan 22, 2022 · It's a common misconception to think of match as like switch in other languages: it is not, not even really close. switch cases are expressions which test for equality against the switch …

  8. Конструкция match-case в Python 3.10 - Stack Overflow на ...

    4.10.2021 выпущен офрелиз Python 3.10. В числе прочих обновлений была предоставлена возможность использования конструкции match-case, которая носит название структурное …

  9. python - How to use match case with a class type - Stack Overflow

    Mar 11, 2022 · I want to use match to determine an action to perform based on a class type. I cannot seem to figure out how to do it. I know their are other ways of achieving this, I would just like to know …

  10. What is the syntactical equivalent to switch/case in Python?

    Mar 30, 2021 · In Python, match is actually much more than a simple switch - therefore probably the name. It features special functionality like deep placeholders and wildcards.