-
Notifications
You must be signed in to change notification settings - Fork 95
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
all: fix iterable object, implement filter
, map
, oct
and optimise hex
#222
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
==========================================
+ Coverage 74.42% 74.52% +0.10%
==========================================
Files 76 78 +2
Lines 12675 12804 +129
==========================================
+ Hits 9433 9542 +109
- Misses 2567 2583 +16
- Partials 675 679 +4
☔ View full report in Codecov by Sentry. |
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.
thanks for the PR.
I have mostly cosmetics comments, see below.
4979c19
to
b184a43
Compare
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.
LGTM
could you split the commits between implementing filter, implementing map, implementing oct and optimising hex ?
(it's good practice and brings easier to understand git-history)
if not, I'll do it, once @ncw chimed in about ObjectIsTrue
.
Of course, I will split commit later |
f364ef9
to
8681126
Compare
I found that the basic types (int, string, etc.) did not run |
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.
LGTM, modulo a very minor nit.
thanks again.
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.
LGTM.
thanks again.
all: support filter builtin feature and fix iterable object
Python-3.4.9/Doc/c-api/iterator.rst
Python-3.4.9/Lib/test/test_builtin.py
In CPython,
Squares (5)
is an iterable object, and to support this type of iterable object, I made modifications toIterator. go
Iterator. go
Corresponding CPython code
Python-3.4.9/Objects/iterobject.c
and
Iter()
Corresponding CPython code
Python-3.4.9/Objects/abstract.c
Finally,
filter
andmap
methods were fully implementedpy/tests/filter.py
is a copy ofPython-3.4.9/Lib/test/test_builtin.py:BuiltinTest.test_filter()
and
py/tests/map.py
is a copy ofPython-3.4.9/Lib/test/test_builtin.py:BuiltinTest.test_map()
builtin: Implement oct and optimise hex
Through benchmark testing, the speed of
hex
has indeed been improvedMy English is not very good, so forgive me for not providing sufficient explanations. Welcome to ask questions here