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.

string.py 505B

1234567891011121314151617181920212223242526
  1. #
  2. # This file is part of pyasn1 software.
  3. #
  4. # Copyright (c) 2005-2018, Ilya Etingof <etingof@gmail.com>
  5. # License: http://snmplabs.com/pyasn1/license.html
  6. #
  7. from sys import version_info
  8. if version_info[:2] <= (2, 5):
  9. def partition(string, sep):
  10. try:
  11. a, c = string.split(sep, 1)
  12. except ValueError:
  13. a, b, c = string, '', ''
  14. else:
  15. b = sep
  16. return a, b, c
  17. else:
  18. def partition(string, sep):
  19. return string.partition(sep)