Dict (version 0.0.4)
index
Dict.html

This package implements tools to build python package and tools.
 
>>> from Dict import *
>>> a = {"a": 0, 0: "a", (0, "a"): ("a", 0)}
>>> b = a.copy()
>>> cleandict(b, ["a"])
{'a': 0}
>>> cleandict(a, ["a"], invers=True)
{0: 'a', (0, 'a'): ('a', 0)}
>>> a
{0: 'a', (0, 'a'): ('a', 0)}
>>> b
{'a': 0}
>>> a = {"a": 0, 0: "a", (0, "a"): ("a", 0)}
>>> copy_cleandict(a, ["a"])
{'a': 0}
>>> copy_cleandict(a, ["a"], invers=True)
{0: 'a', (0, 'a'): ('a', 0)}
>>> a
{'a': 0, 0: 'a', (0, 'a'): ('a', 0)}
>>> d = dict(zip([0,1], (2,3)))
>>> _ = d | print
0 2
1 3
>>> _ = d @ print
0
1
>>> _ = d >> print
2
3
>>> d - [0]
{1: 3}
>>> d + [0]
{0: 2}
>>> from math import factorial, gcd
>>> d @= factorial
>>> d
{0: 1, 1: 1}
>>> d = dict(zip([0,1], (2,3)))
>>> d >>= factorial
>>> d
{0: 2, 1: 6}
>>> d |= gcd
>>> d
{0: 2, 1: 1}
>>> ~d
{2: 0, 1: 1}
>>> d -= [0]
>>> d
{1: 1}
>>> d[2] = 0
>>> d += [2]
>>> d
{2: 0}
>>>

 
Classes
       
builtins.dict(builtins.object)
dict

 
class dict(builtins.dict)
    
Method resolution order:
dict
builtins.dict
builtins.object

Methods defined here:
__add__(self, other: collections.abc.Iterator[collections.abc.Hashable]) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> + <Iterator>'
__iadd__(self, other: collections.abc.Iterator[collections.abc.Hashable]) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> += <Iterator>'
__imatmul__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> @= function'.
__inv__(self) -> Dict[collections.abc.Hashable, Any]
This function implements '~<dict>'.
__invert__(self) -> Dict[collections.abc.Hashable, Any]
This function implements '~<dict>'.
__ior__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> |= <function>'.
__irshift__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> >> function'.
__isub__(self, other: collections.abc.Iterator[collections.abc.Hashable]) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> -= <Iterator>'
__matmul__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> @ function'.
__or__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> | <function>'.
__rshift__(self, other: collections.abc.Callable) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> >> function'.
__sub__(self, other: collections.abc.Iterator[collections.abc.Hashable]) -> Dict[collections.abc.Hashable, Any]
This function implements '<dict> - <Iterator>'

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from builtins.dict:
__contains__(self, key, /)
True if the dictionary has the specified key, else False.
__delitem__(self, key, /)
Delete self[key].
__eq__(self, value, /)
Return self==value.
__ge__(self, value, /)
Return self>=value.
__getattribute__(self, name, /)
Return getattr(self, name).
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(self, value, /)
Return self>value.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.
__iter__(self, /)
Implement iter(self).
__le__(self, value, /)
Return self<=value.
__len__(self, /)
Return len(self).
__lt__(self, value, /)
Return self<value.
__ne__(self, value, /)
Return self!=value.
__repr__(self, /)
Return repr(self).
__reversed__(self, /)
Return a reverse iterator over the dict keys.
__ror__(self, value, /)
Return value|self.
__setitem__(self, key, value, /)
Set self[key] to value.
__sizeof__(...)
D.__sizeof__() -> size of D in memory, in bytes
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(self, key, default=None, /)
Return the value for key if key is in the dictionary, else default.
items(...)
D.items() -> a set-like object providing a view on D's items
keys(...)
D.keys() -> a set-like object providing a view on D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
 
If the key is not found, return the default if given; otherwise,
raise a KeyError.
popitem(self, /)
Remove and return a (key, value) pair as a 2-tuple.
 
Pairs are returned in LIFO (last-in, first-out) order.
Raises KeyError if the dict is empty.
setdefault(self, key, default=None, /)
Insert key with a value of default if key is not in the dictionary.
 
Return the value for key if key is in the dictionary, else default.
update(...)
D.update([E, ]**F) -> None.  Update D from dict/iterable E and F.
If E is present and has a .keys() method, then does:  for k in E: D[k] = E[k]
If E is present and lacks a .keys() method, then does:  for k, v in E: D[k] = v
In either case, this is followed by: for k in F:  D[k] = F[k]
values(...)
D.values() -> an object providing a view on D's values

Class methods inherited from builtins.dict:
__class_getitem__(...) from builtins.type
See PEP 585
fromkeys(iterable, value=None, /) from builtins.type
Create a new dictionary with keys from iterable and values set to value.

Static methods inherited from builtins.dict:
__new__(*args, **kwargs) from builtins.type
Create and return a new object.  See help(type) for accurate signature.

Data and other attributes inherited from builtins.dict:
__hash__ = None

 
Functions
       
cleandict(dict_: dict, keys: List[collections.abc.Hashable], invers: bool = False) -> dict
This function clean a dictionary.
copy_cleandict(dict_: dict, *args, **kwargs) -> dict
This function copy and clean a dictionary.
 
args and kwargs are passed to cleandict.

 
Data
        __all__ = ['cleandict', 'copy_cleandict', 'dict']
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nPythonToolsKit Copyright (C) 2022 Maurice Lam...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements tools to build python package and tools.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/PythonToolsKit'

 
Author
        Maurice Lambert
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy