[issue34554] Add match built-in function

2018-08-31 Thread mokhalid


mokhalid  added the comment:

Thanks so much, I will do it :)

--

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



[issue34554] Add match built-in function

2018-08-31 Thread mokhalid


Change by mokhalid :


--
title: Add match built in functio -> Add match built-in function

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



[issue34554] Add match built in functio

2018-08-31 Thread mokhalid


Change by mokhalid :


--
title: add match built in function -> Add match built in functio

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



[issue34554] add match built in function

2018-08-31 Thread mokhalid


mokhalid  added the comment:

sorry I forget to print text i mean:
match([2,5,4,'Hello']):
  2: print('here is 2')
  6: print('here is 6')
elif 'Hello': print('Hello world')
  8:print('here is 8')
elif 'python': print('Hello world')
else: print('MoKhalid')

--

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



[issue34554] add match built in function

2018-08-31 Thread mokhalid


New submission from mokhalid :

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 
<https://bugs.python.org/issue34554>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com