New submission from mokhalid <mohammedkhaild...@gmail.com>:

match built-in function feature request:

what is the match function do?
the match function is doing something like if but with quick easy syntax that 
even beginners can use.

possible syntax:

match(list or string or dictionary):
  condition: event here
  condition: event here
#all conditions are applied at the same time as if not elif and else
#but you use elif or else.

ex:
match(list or string or dictionary):
  condition: event here
  condition: event here
    elif condition: event here
    else: event here
 

example of what I mean:
match([2,5,4,'Hello']):
  2: print('here is 2')
  6: print('here is 6')
    elif 'Hello': ('Hello world')
  8:print('here is 8')
    elif 'python': ('Hello world')
    else: print('MoKhalid')

the output should look like:
here is 2
Hello world
MoKhalid

----------
components: Regular Expressions
messages: 324425
nosy: MoKhaild, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: add match built in function
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34554>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to