Skip to content

Conversation

@tsnoam
Copy link
Member

@tsnoam tsnoam commented Aug 1, 2017

No description provided.

@tsnoam tsnoam requested a review from Eldinnie August 1, 2017 20:05
Copy link
Member

@Eldinnie Eldinnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 small docstring things, looks good.

def effective_attachment(self):
"""
Optional[Union[:class:`telegram.Audio`, :class:`telegram.Game`, :class:`telegram.Document`,
:class:`telegram.Photo`, :class:`telegram.Sticker`, :class:`telegram.Video`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

telegram.Photo does not exists. Should be List[:class:`telegram.PhotoSize`]

:class:`telegram.Voice`, :class:`telegram.VideoNote`, :class:`telegram.Contact`,
:class:`telegram.Location`, :class:`telegram.Venue`, :class:`telegram.Invoice`,
:class:`telegram.SuccessfulPayment`]]: The attachment that this message was sent with. May
be ``None`` if no attachment was sent.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space too much at start of line, makes weird docs.

@property
def effective_attachment(self):
"""
Optional[Union[:class:`telegram.Audio`, :class:`telegram.Game`, :class:`telegram.Document`,
Copy link
Member

@jsmnbom jsmnbom Aug 1, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be:

 :class:`telegram.Audio` | :class:`telegram.Game` | :class:`telegram.Document` [...]

I'm not sure our sphinx parser understands the optional and union very well

Edit:
After testing it, it understands neither, so something like below might be clearest actually:

:class:`telegram.Audio` or :class:`telegram.Game` or :class:`telegram.Document` or
    :class:`telegram.Photo` or :class:`telegram.Sticker` or :class:`telegram.Video` or
    :class:`telegram.Voice` or :class:`telegram.VideoNote` or :class:`telegram.Contact` or
    :class:`telegram.Location` or :class:`telegram.Venue` or :class:`telegram.Invoice` or
    :class:`telegram.SuccessfulPayment`: The attachment that this message was
    sent with. May be ``None`` if no attachment was sent.

@Eldinnie
Copy link
Member

Eldinnie commented Aug 7, 2017

I thought I had put this here, but apparently I only mentioned it in chat. photo is of type List[:class:'telegram.PhotoSize'] and I would like it visually better if the possible attachments would be listed in alphabetical order.

[ci skip]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants