News for hackers. Stuff that matters.
Re:Python adopts a 12-month release cycle by m463 on Tuesday November 05, 2019 @10:08PM (#21459401)
I used perl almost exclusively before moving to python and it is very easy to use regular expressions.

Now I use python and love how it is better at separating the expression from the python language (with perl you were never sure if you had escaped things correctly)

but pyython is just... clumsy

  m = re.match(r'xyz',str)
  if m:
    do a
  else:
    m = re.match(r'wxy',str)
    if m:
      do b
    else:
      m = re.match(r'abc', str)
      if m:
        do c:
      else:
        ...
vs:

  if m := re.match(r'xyz',str):
     do a
  elif m := re.match(r'wxy',str)
     do b
  elif m := re.match(r'abc',str)
     do c
  ...

There are no comments on this comment yet.