-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add List #65
Conversation
tests/types_test.py
Outdated
assert immutable_list.index(2) == 1 | ||
assert immutable_list.count(1) == 1 | ||
assert immutable_list.count(2) == 1 | ||
assert immutable_list.count(3) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이쪽도 파일명 바꿉시다.
nirum/datastructures.py
Outdated
__all__ = 'ImmutableList', | ||
|
||
|
||
class ImmutableList(collections.Sequence): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
니름쪽과 같은 이름으로 간단하게 List
로 짓는 건 어떨까요?
tests/types_test.py
Outdated
with raises(TypeError): | ||
immutable_list + [3] | ||
|
||
assert isinstance(immutable_list, collections.Sequence) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사소하지만 collections.MutableSequence
가 아닌지도 검사하면 좋을 듯하네요.
d563815
to
ee413c4
Compare
ee413c4
to
a1ab6f5
Compare
@dahlia changelog 도 쓰고 리뷰해주셨던거 반영했습니다. |
collections.Sequence
를 구현하는nirum.datastructures.List
를 구현합니다.