Python Object Value Shorthand

python
sorcery library
dictionary creation
code example
stack overflow
variable manipulation
programming
This article demonstrates the usage of the ‘sorcery’ library in Python for generating dictionaries from variables. It includes a code snippet and refers to a related question on Stack Overflow for further assistance.
Published

April 23, 2024


Use sorcery

import sorcery
a,b,c = 1,2,3
mydict = sorcery.dict_of(a,b,c)

Related question