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

Improve examples #112

Closed
czgdp1807 opened this issue Mar 1, 2020 · 3 comments · Fixed by #123
Closed

Improve examples #112

czgdp1807 opened this issue Mar 1, 2020 · 3 comments · Fixed by #123

Comments

@czgdp1807
Copy link
Member

Description of the problem

In the following snippet,

>>> from pydatastructs import DoublyLinkedList
>>> dll = DoublyLinkedList()
>>> dll.append(6)
>>> dll[0].data
6
>>> dll.head.data
6
>>> dll.append(5)
>>> dll.append_left(2)
>>> print(dll)
[2, 6, 5]
>>> dll[0].data = 7.2
>>> dll.extract(1).data
6
>>> print(dll)

print has been used for showing string output, instead, str should have been used. Changes should be made in the above part of the code as well as such things should be checked in other parts of the codebase as well and a single PR should be made for such improvements.

Example of the problem

References/Other comments

@czgdp1807 czgdp1807 added the easy label Mar 1, 2020
@czgdp1807
Copy link
Member Author

Some classes don't have examples. This can be done in a separate PR other than one doing the above fixes.

@iamrajiv
Copy link
Contributor

iamrajiv commented Mar 4, 2020

@czgdp1807 changing print() with str() is giving DocTestFailure. For example str() is returning like this '[7.2, 5]'

@czgdp1807
Copy link
Member Author

Yeah so you can make changes to the results by adding '.

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

Successfully merging a pull request may close this issue.

2 participants