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

Add Return information to docstring. #4

Open
erewok opened this issue Feb 13, 2017 · 1 comment
Open

Add Return information to docstring. #4

erewok opened this issue Feb 13, 2017 · 1 comment

Comments

@erewok
Copy link
Owner

erewok commented Feb 13, 2017

Docstring now doesn't contain a returns: section, which would make it a little more official.

Ideally, we'd include more information about the types of things that go into the functions as arguments, including the data payload, etc. That may involve more knowledge about Python than this library currently pretends to.

In addition, we should be able to include some information in the returns section about the kind of object likely to get returned.

@erewok
Copy link
Owner Author

erewok commented Feb 16, 2017

Use Data.Typeable for this?

Prelude> import Data.Typeable
Prelude Data.Typeable> show $ typeOf 5
"Integer"
Prelude Data.Typeable> show $ typeOf (5 :: Int)
"Int"

One thing that may be useful is to define a version of the Options type that includes more information about request bodies and also about objects returned, which we could put into the docstrings to help users.

The thing is, the objects going into and getting returned from APIs would need to derive Data and Typeable for this to work, so it could be fiddly and confusing why a particular options parameter makes things suddenly start breaking.

Inspiration for using Typeable and Data can be seen here:

@erewok erewok self-assigned this Feb 17, 2017
@erewok erewok removed their assignment Dec 1, 2018
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