8000 Add List by kanghyojun · Pull Request #65 · nirum-lang/nirum-python · GitHub
[go: up one dir, main page]

Skip to content

Add List #65

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

Merged
merged 6 commits into from
Mar 20, 2017
Merged

Add List #65

merged 6 commits into from
Mar 20, 2017

Conversation

kanghyojun
Copy link
Member
@kanghyojun kanghyojun commented Mar 19, 2017

collections.Sequence를 구현하는 nirum.datastructures.List를 구현합니다.

assert immutable_list.index(2) == 1
assert immutable_list.count(1) == 1
assert immutable_list.count(2) == 1
assert immutable_list.count(3) == 0
Copy link
Member

Choose a reason for hiding this comment

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

이쪽도 파일명 바꿉시다.

__all__ = 'ImmutableList',


class ImmutableList(collections.Sequence):
Copy link
Member

Choose a reason for hiding this comment

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

니름쪽과 같은 이름으로 간단하게 List로 짓는 건 어떨까요?

with raises(TypeError):
immutable_list + [3]

assert isinstance(immutable_list, collections.Sequence)
Copy link
Member

Choose a reason for hiding this comment

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

사소하지만 collections.MutableSequence가 아닌지도 검사하면 좋을 듯하네요.

@kanghyojun
Copy link
Member Author

@dahlia changelog 도 쓰고 리뷰해주셨던거 반영했습니다.

@kanghyojun kanghyojun changed the title Add ImmutableList Add List Mar 20, 2017
@kanghyojun kanghyojun merged commit 64b59e9 into nirum-lang:master Mar 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0