You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
"""Реализация декоратора to_json"""
|
|
|
|
from functools import wraps
|
|
from json import dumps
|
|
|
|
|
|
def to_json(func):
|
|
"""Декоратора to_json"""
|
|
|
|
@wraps(func)
|
|
def wrapped(*args, **kwargs):
|
|
return dumps(func(*args, **kwargs))
|
|
|
|
return wrapped
|