File: compat.py

package info (click to toggle)
python-tr 0.1%2Bgit20161102.e74d4bd-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 120 kB
  • sloc: python: 159; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 313 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# -*- coding: utf-8 -*-
import sys


if sys.version_info < (3, ):  # for Python 2.x
    from itertools import imap, izip
    map = imap
    chr = unichr
    range = xrange
    zip = izip
    valid_source_type = unicode
else:
    map = map
    chr = chr
    range = range
    zip = zip
    valid_source_type = str