File: compat.py

package info (click to toggle)
python-jmespath 1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 240 kB
  • sloc: python: 1,754; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 381 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import sys
import inspect
from itertools import zip_longest


text_type = str
string_type = str


def with_str_method(cls):
    # In python3, we don't need to do anything, we return a str type.
    return cls

def with_repr_method(cls):
    return cls

def get_methods(cls):
    for name, method in inspect.getmembers(cls, predicate=inspect.isfunction):
        yield name, method