]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Uniform date/time loaders naming
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sun, 16 May 2021 01:38:00 +0000 (03:38 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 1 Jun 2021 23:57:23 +0000 (00:57 +0100)
Just use the type name with one uppercase, no camels here.

psycopg3/psycopg3/types/__init__.py
psycopg3/psycopg3/types/date.py

index 3826058bc287051c6f2b8a9295f501fde8ccebde..511dcbf02a177333143e4b19e267ea4de7932c85 100644 (file)
@@ -96,12 +96,12 @@ from .date import (
     DateBinaryLoader as DateBinaryLoader,
     TimeLoader as TimeLoader,
     TimeBinaryLoader as TimeBinaryLoader,
-    TimeTzLoader as TimeTzLoader,
-    TimeTzBinaryLoader as TimeTzBinaryLoader,
+    TimetzLoader as TimetzLoader,
+    TimetzBinaryLoader as TimetzBinaryLoader,
     TimestampLoader as TimestampLoader,
     TimestampBinaryLoader as TimestampBinaryLoader,
-    TimestampTzLoader as TimestampTzLoader,
-    TimestampTzBinaryLoader as TimestampTzBinaryLoader,
+    TimestamptzLoader as TimestamptzLoader,
+    TimestamptzBinaryLoader as TimestamptzBinaryLoader,
     IntervalLoader as IntervalLoader,
     IntervalBinaryLoader as IntervalBinaryLoader,
 )
@@ -227,12 +227,12 @@ def register_default_globals(ctx: AdaptContext) -> None:
     DateBinaryLoader.register("date", ctx)
     TimeLoader.register("time", ctx)
     TimeBinaryLoader.register("time", ctx)
-    TimeTzLoader.register("timetz", ctx)
-    TimeTzBinaryLoader.register("timetz", ctx)
+    TimetzLoader.register("timetz", ctx)
+    TimetzBinaryLoader.register("timetz", ctx)
     TimestampLoader.register("timestamp", ctx)
     TimestampBinaryLoader.register("timestamp", ctx)
-    TimestampTzLoader.register("timestamptz", ctx)
-    TimestampTzBinaryLoader.register("timestamptz", ctx)
+    TimestamptzLoader.register("timestamptz", ctx)
+    TimestamptzBinaryLoader.register("timestamptz", ctx)
     IntervalLoader.register("interval", ctx)
     IntervalBinaryLoader.register("interval", ctx)
 
index 430294c83df6e8f66dfe959f8550fbdf826eaedd..5b3dee5fb38ce0b0ede55123a4211ffbc992a493 100644 (file)
@@ -348,7 +348,7 @@ class TimeBinaryLoader(Loader):
             ) from None
 
 
-class TimeTzLoader(Loader):
+class TimetzLoader(Loader):
 
     format = Format.TEXT
     _py37 = sys.version_info >= (3, 7)
@@ -394,7 +394,7 @@ class TimeTzLoader(Loader):
             raise DataError(f"can't manage timetz {s!r}: {e}") from None
 
 
-class TimeTzBinaryLoader(Loader):
+class TimetzBinaryLoader(Loader):
 
     format = Format.BINARY
 
@@ -423,7 +423,7 @@ class TimeTzBinaryLoader(Loader):
 
 if sys.version_info < (3, 7):
     setattr(
-        TimeTzBinaryLoader, "_tz_from_sec", TimeTzBinaryLoader._tz_from_sec_36
+        TimetzBinaryLoader, "_tz_from_sec", TimetzBinaryLoader._tz_from_sec_36
     )
 
 
@@ -545,7 +545,7 @@ class TimestampBinaryLoader(Loader):
                 ) from None
 
 
-class TimestampTzLoader(Loader):
+class TimestamptzLoader(Loader):
 
     format = Format.TEXT
     _re_format = re.compile(
@@ -614,7 +614,7 @@ class TimestampTzLoader(Loader):
         )
 
 
-class TimestampTzBinaryLoader(Loader):
+class TimestamptzBinaryLoader(Loader):
 
     format = Format.BINARY