fix for hashable types

pull/1/head
penn5 2022-08-09 21:13:36 +01:00 committed by GitHub
parent 8e417eaf95
commit 7d4ad92325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 9 deletions

View File

@ -12,6 +12,7 @@ import logging
import os
import time
import asyncio
import collections
try:
import psycopg2
@ -32,13 +33,9 @@ from telethon.tl.types import Message
from telethon.errors.rpcerrorlist import ChannelsTooMuchError
from . import utils, main
from ._types import (
PointerBool,
PointerInt,
PointerStr,
from .pointers import (
PointerList,
PointerDict,
PointerTuple,
)
DATA_DIR = (
@ -387,12 +384,9 @@ class Database(dict):
"""Get a pointer to database key"""
value = self.get(owner, key, default)
mapping = {
int: PointerInt,
str: PointerStr,
bool: PointerBool,
list: PointerList,
dict: PointerDict,
tuple: PointerTuple,
collections.abc.Hashable: lambda v: v,
}
pointer_constructor = next(