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

Effective attachment #766

Merged
merged 4 commits into from Aug 7, 2017

Conversation

Projects
None yet
3 participants
@tsnoam
Copy link
Member

tsnoam commented Aug 1, 2017

No description provided.

@tsnoam tsnoam requested a review from Eldinnie Aug 1, 2017

@Eldinnie
Copy link
Member

Eldinnie left a comment

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`,

This comment has been minimized.

@Eldinnie

Eldinnie Aug 1, 2017

Member

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.

This comment has been minimized.

@Eldinnie

Eldinnie Aug 1, 2017

Member

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`,

This comment has been minimized.

@jsmnbom

jsmnbom Aug 1, 2017

Member

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

This comment has been minimized.

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.

another CR fix
[ci skip]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.