Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

func_return_yield_mix_py_33.py 353B

123456789101112131415
  1. """pylint should detect yield and return mix inside generators"""
  2. # pylint: disable=using-constant-test, inconsistent-return-statements
  3. def somegen():
  4. """this is a bad generator"""
  5. if True:
  6. return 1
  7. else:
  8. yield 2
  9. def moregen():
  10. """this is another bad generator"""
  11. if True:
  12. yield 1
  13. else:
  14. return 2