Python Match With Block Logic

Descripción

Match-case using block logic to assign a value


File Template: ❌


Prefix

match:yield


Scopes

python


Snippet de código

match ${2:value}:
	case ${3:'A'}:
		${4:# complex logic}
		${1:result} = ${5:'Result A'}
	case ${6:'B'}:
		${1:result} = ${7:'Result B'}
	case _:
		${1:result} = ${8:'Default'}