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_noerror_overloaded_operator.py 452B

123456789101112131415161718192021
  1. # pylint: disable=C0111,R0903
  2. """#3291"""
  3. from __future__ import print_function
  4. class Myarray(object):
  5. def __init__(self, array):
  6. self.array = array
  7. def __mul__(self, val):
  8. return Myarray(val)
  9. def astype(self):
  10. return "ASTYPE", self
  11. def randint(maximum):
  12. if maximum is not None:
  13. return Myarray([1, 2, 3]) * 2
  14. return int(5)
  15. print(randint(1).astype()) # we don't wan't an error for astype access