Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Jdict show cases and use cases #5

Open
ShahriyarR opened this issue Jan 28, 2022 · 3 comments
Open

[TASK] Jdict show cases and use cases #5

ShahriyarR opened this issue Jan 28, 2022 · 3 comments
Assignees

Comments

@ShahriyarR
Copy link
Contributor

Describe the task

Need to find awesome use cases and show cases for README

@ShahriyarR ShahriyarR self-assigned this Jan 28, 2022
@ShahriyarR
Copy link
Contributor Author

First one easy looping:

In [23]: for key, value in new_data.data.file.metadata.items():
    ...:     print(key, value)
    ...: 
    ...: 
size {'bytes': 63, 'readable': '63 B'}
name test_py
id n2weifEcx5

@ShahriyarR
Copy link
Contributor Author

Second is easy value assignment:

n [26]: new_data.status = False

In [27]: new_data
Out[27]: 
{'status': False,
 'data': {'file': {'url': {'short': 'https://anonfiles.com/n2weifEcx5',
    'full': 'https://anonfiles.com/n2weifEcx5/test_py'},
   'metadata': {'size': {'bytes': 63, 'readable': '63 B'},
    'name': 'test_py',
    'id': 'n2weifEcx5'}}}}

@ShahriyarR
Copy link
Contributor Author

We should describe that jdict acts an ordinary dict type in Python, i.e the copy is the default:

In [28]: hex(id(new_data.data.file))
Out[28]: '0x7fd254d8e4f0'

In [29]: a = new_data.data.file

In [30]: hex(id(a))
Out[30]: '0x7fd254d8e4f0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant