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

Remove mutable args. Fix 1561. #1562

Merged
merged 3 commits into from Sep 4, 2017

Conversation

zsef123
Copy link
Contributor

@zsef123 zsef123 commented Sep 2, 2017

Issue #1561

Mutable default arguments changed to None

@menshikh-iv
Copy link
Contributor

Thank you @zsef123

@menshikh-iv menshikh-iv merged commit 32e0257 into piskvorky:develop Sep 4, 2017
@zsef123 zsef123 deleted the change-mutable-args branch September 4, 2017 20:31
@menshikh-iv menshikh-iv changed the title Change mutable args Remove mutable args. Fix 1561. Sep 5, 2017
@menshikh-iv menshikh-iv added this to Done in Code cleanup Sep 5, 2017
@@ -422,7 +422,7 @@ def init_sims(self, replace=False):
self.doctag_syn0norm = empty(self.doctag_syn0.shape, dtype=REAL)
np_divide(self.doctag_syn0, sqrt((self.doctag_syn0 ** 2).sum(-1))[..., newaxis], self.doctag_syn0norm)

def most_similar(self, positive=[], negative=[], topn=10, clip_start=0, clip_end=None, indexer=None):
def most_similar(self, positive=None, negative=None, topn=10, clip_start=0, clip_end=None, indexer=None):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Making these defaults empty tuples – () – could enforce the immutability, and eliminate the later None-check/assignments.

@zsef123 zsef123 restored the change-mutable-args branch September 6, 2017 00:02
@zsef123 zsef123 deleted the change-mutable-args branch September 6, 2017 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants