Skip to content

Conversation

@tonyyang-svail
Copy link

No description provided.

return True
return False

if inputs is not None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this assuming inputs is not possible to be None? If so maybe we need to remove the default None value from the argument list.

@tonyyang-svail tonyyang-svail changed the title [WIP] framework.py enhancement framework.py enhancement Feb 22, 2018
helinwang
helinwang previously approved these changes Feb 22, 2018
Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

LGTM!

for attr in proto.attrs:
attr_name = attr.name
if (not attr_name in attrs) or (attrs[attr_name] is None):
if (attr_name not in attrs) or (attrs[attr_name] is None):
Copy link
Contributor

Choose a reason for hiding this comment

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

Hard to believe Python can do the same thing with so many different ways...

Copy link
Author

Choose a reason for hiding this comment

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

From PEP8

Use is not operator rather than not ... is. While both expressions are 
functionally identical, the former is more readable and preferred.

Yes:

if foo is not None:

No:

if not foo is None:

Copy link
Contributor

@helinwang helinwang Feb 22, 2018

Choose a reason for hiding this comment

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

Thanks for the info. It's better if only one is allowed by the syntax.

helinwang
helinwang previously approved these changes Feb 23, 2018
Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Contributor

@helinwang helinwang left a comment

Choose a reason for hiding this comment

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

LGTM!

@tonyyang-svail tonyyang-svail merged commit d4dabe3 into PaddlePaddle:develop Feb 23, 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

Successfully merging this pull request may close these issues.

2 participants