diff options
author | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-05-28 17:28:54 -0700 |
---|---|---|
committer | Victor Uriarte <victor.m.uriarte@intel.com> | 2016-05-29 11:33:31 -0700 |
commit | 7e88aa243ed3356655b3a86da42e4d5dffb2bf10 (patch) | |
tree | 220ba6d98f427169914990599e7556c6f48ef1d7 /sqlparse/compat.py | |
parent | 6b95b43014db358527f53e8b191999d2f753f0a9 (diff) | |
download | sqlparse-7e88aa243ed3356655b3a86da42e4d5dffb2bf10.tar.gz |
Bid Adieu to metaclass
The singleton pattern isn't applicable since only one language is being
implemented.
Simplify Lexer initialization.
Fix compat func `u` on Py3. Signature didn't match Py2.
Feature isn't used yet.
Diffstat (limited to 'sqlparse/compat.py')
-rw-r--r-- | sqlparse/compat.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/sqlparse/compat.py b/sqlparse/compat.py index 334883b..84d0c96 100644 --- a/sqlparse/compat.py +++ b/sqlparse/compat.py @@ -14,7 +14,7 @@ PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: - def u(s): + def u(s, encoding=None): return str(s) @@ -37,17 +37,3 @@ elif PY2: text_type = unicode string_types = (basestring,) from StringIO import StringIO - - -# Directly copied from six: -def with_metaclass(meta, *bases): - """Create a base class with a metaclass.""" - - # This requires a bit of explanation: the basic idea is to make a dummy - # metaclass for one level of class instantiation that replaces itself with - # the actual metaclass. - class metaclass(meta): - def __new__(cls, name, this_bases, d): - return meta(name, bases, d) - - return type.__new__(metaclass, 'temporary_class', (), {}) |