Skip to content

Commit

Permalink
Remove unused regexps
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Sep 3, 2023
1 parent 607ee83 commit 62594ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
3 changes: 0 additions & 3 deletions pg.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,9 +1359,6 @@ def typecast(self, value, typ):
return cast(value)


_re_fieldname = regex('^[A-Za-z][_a-zA-Z0-9]*$')


# The result rows for database operations are returned as named tuples
# by default. Since creating namedtuple classes is a somewhat expensive
# operation, we cache up to 1024 of these classes by default.
Expand Down
17 changes: 8 additions & 9 deletions pgdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
connection.close() # close the connection
"""

from __future__ import print_function, division
from __future__ import division, print_function

try:
from _pg import *
Expand Down Expand Up @@ -116,19 +116,22 @@
'get_typecast', 'set_typecast', 'reset_typecast',
'version', '__version__']

from datetime import date, time, datetime, timedelta, tzinfo
from time import localtime
from datetime import date, datetime, time, timedelta, tzinfo
from decimal import Decimal as StdDecimal
from math import isinf, isnan
from time import localtime
from uuid import UUID as Uuid
from math import isnan, isinf

try: # noinspection PyCompatibility
from collections.abc import Iterable
except ImportError: # Python < 3.3
from collections import Iterable

from collections import namedtuple
from functools import partial
from json import dumps as jsonencode
from json import loads as jsondecode
from re import compile as regex
from json import loads as jsondecode, dumps as jsonencode

Decimal = StdDecimal

Expand Down Expand Up @@ -900,10 +903,6 @@ def _op_error(msg):

# *** Row Tuples ***


_re_fieldname = regex('^[A-Za-z][_a-zA-Z0-9]*$')


# The result rows for database operations are returned as named tuples
# by default. Since creating namedtuple classes is a somewhat expensive
# operation, we cache up to 1024 of these classes by default.
Expand Down

0 comments on commit 62594ff

Please sign in to comment.