2013-10-09 14:28:54 +00:00
|
|
|
# -*- encoding: utf-8 -*-
|
|
|
|
|
|
|
|
import sys
|
|
|
|
PY2K = sys.version_info[0] == 2
|
|
|
|
|
|
|
|
if not PY2K:
|
2013-10-29 11:01:45 +00:00
|
|
|
|
|
|
|
map, zip, filter = map, zip, filter
|
2014-02-18 15:52:26 +00:00
|
|
|
from functools import reduce
|
2013-10-09 14:28:54 +00:00
|
|
|
|
2014-03-25 17:38:17 +00:00
|
|
|
iteritems = lambda dikt: iter(dikt.items())
|
|
|
|
|
2013-10-09 14:28:54 +00:00
|
|
|
text_type = str
|
|
|
|
string_types = (str, )
|
|
|
|
|
|
|
|
buffer = memoryview
|
|
|
|
else:
|
2013-10-29 11:01:45 +00:00
|
|
|
|
|
|
|
from itertools import imap, izip, ifilter
|
|
|
|
map, zip, filter = imap, izip, ifilter
|
2014-02-18 15:52:26 +00:00
|
|
|
reduce = reduce
|
2013-10-09 14:28:54 +00:00
|
|
|
|
2014-03-25 17:38:17 +00:00
|
|
|
iteritems = lambda dikt: dikt.iteritems()
|
|
|
|
|
2013-10-09 14:28:54 +00:00
|
|
|
text_type = unicode
|
|
|
|
string_types = (str, unicode)
|
|
|
|
|
|
|
|
buffer = buffer
|