Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""LICENSE Copyright 2018 Hermann Krumrey <hermann@krumreyh.com>
This file is part of anime-list-apis.
anime-list-apis is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
anime-list-apis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with anime-list-apis. If not, see <http://www.gnu.org/licenses/>. LICENSE"""
""" Enumeration of different ID types """
""" Class that models an ID. Has the capability to store different ID types """
""" Initializes the ID. The IDs are set using a dictionary mapping IDs to the different ID types. At least one entry is required. Missing IDs will be replaced with None :param ids: The IDs mapped to an IdType :raises TypeError: If an invalid parameter type was provided :raises ValueError: In case no valid ID was provided """ key: value for key, value in ids.items() if self.type_check(value, int) }
# noinspection PyTypeChecker
""" Retrieves an ID for a given ID type :param id_type: The ID type to get :return: The ID. If it does not exist, return None """
""" Sets an ID for a given ID type :param _id: The ID to set :param id_type: The type of ID for which to set the ID :return: None :raises TypeError: If the provided ID is not an integer """
or Dict or List or Tuple or Set]]: """ Serializes the object into a dictionary :return: The serialized form of this object """
or Dict or List or Tuple or Set]]): """ Deserializes a dictionary into an object of this type :param data: The data to deserialize :return: The deserialized object :raises TypeError: If a type error occurred :raises ValueError: If the data could not be deserialized """
""" Checks for equality with another object. Needed to make IDs hashable :param other: The other object :return: True if equal, False otherwise """ else:
""" Generates a hash so that IDs can be used as keys in dictionaries :return: The hash """ |