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 type annotations #938

Closed

Conversation

hyunchel
Copy link
Contributor

@hyunchel hyunchel commented Jun 5, 2016

Type of parameter for function is_recent(line no.812) is datetime.
MyPy errors out, however, when the parameter is defined as datetime.
To get around, type Any is used.

@smarx
Copy link

smarx commented Jun 5, 2016

Automated message from Dropbox CLA bot

@hyunchel, thanks for the pull request! It looks like you haven't yet signed the Dropbox CLA. Please sign it here.

@hyunchel
Copy link
Contributor Author

hyunchel commented Jun 5, 2016

Signed, thanks!

@smarx
Copy link

smarx commented Jun 5, 2016

Automated message from Dropbox CLA bot

@hyunchel, thanks for signing the CLA!

@@ -43,6 +46,7 @@ def fix_row(row):
return content

def dictfetchall(cursor):
# type: (Any) -> List[Dict[str, Any]]
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

I think cursor is of type connection.cursor

@timabbott
Copy link
Sponsor Member

@hyunchel I posted some comments on how to make the types more precise.

Type of parameter for function `is_recent`(line no.812) is `datetime`.
MyPy errors out, however, when the parameter is defined as `datetime`.
To get around, type `Any` is used.
@hyunchel hyunchel force-pushed the type-annotation/analytics-views branch from 6120396 to a84fae2 Compare June 5, 2016 20:56
@hyunchel
Copy link
Contributor Author

hyunchel commented Jun 5, 2016

@timabbott Changes based on your review are applied and force pushed.

@hyunchel
Copy link
Contributor Author

hyunchel commented Jun 5, 2016

Type check for datetime is ignored for now.

age = datetime.now(val.tzinfo) - val # type: ignore # datetie.now tzinfo bug.

(line no.819)

@timabbott
Copy link
Sponsor Member

Merged, thanks @hyunchel!

@timabbott timabbott closed this Jun 5, 2016
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 this pull request may close these issues.

None yet

3 participants