Moving Constructor definition to the top like a Function definition #5103

Closed
ankit-maverick opened this Issue Feb 12, 2014 · 5 comments

Projects

None yet

4 participants

@ankit-maverick

I would like to know if there is any specific reason for displaying the constructor definition at the bottom unlike a normal function definition. Currently it is less user-friendly to check up the default values of the arguments in the constructor. For example : scikit-image/scikit-image#885 (comment)

@Carreau Carreau added this to the 2.0 milestone Feb 12, 2014
@Carreau
Member
Carreau commented Feb 12, 2014

Hum... even wondering if this is not a regression...
I'll mark as 2.0, but not sure it will make it through.

@takluyver
Member

I don't think this is a regression - I think we've always printed the class docstring above the constructor info. We have to guess what is most likely to be useful to the user, and it's not clear that putting constructor info above the class docstring is better.

@takluyver takluyver removed the regression label Feb 12, 2014
@Carreau
Member
Carreau commented Feb 12, 2014

Oh, I read it was the constructor signature.

Maybe we can peek at which one have the less lines. If constructor have less lines, it is probably just info on the signature right ?

@takluyver
Member

It is constructor signature in the example shown, but we group constructor info - docstring, signature, etc. - together.

@minrk
Member
minrk commented Mar 6, 2014

#5285 makes the proposed change, and should improve the output for classes and callable objects

@takluyver takluyver closed this in #5285 Mar 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment