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

新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 #147

Merged
merged 10 commits into from Dec 5, 2018

Conversation

Projects
None yet
3 participants
@howl-anderson
Copy link
Contributor

howl-anderson commented Nov 30, 2018

PR 描述

代码:

from pypinyin import pinyin

result = pinyin('你好!🙂', errors=lambda x: [i for i in x])
print(result)

改动前输出:

[['nǐ'], ['hǎo'], ['!🙂']]

改动后输出:

[['nǐ'], ['hǎo'], ['!'], ['🙂']]

其他内置 errors 处理选项功能不变

待办事项

  • 符合代码规范
  • 单元测试
  • 文档
@pep8speaks

This comment has been minimized.

Copy link

pep8speaks commented Nov 30, 2018

Hello @howl-anderson! Thanks for updating the PR.

Comment last updated on November 30, 2018 at 15:23 Hours UTC

@howl-anderson howl-anderson changed the title [WIP]新特性:errors 为 callable 对象时,返回 list 将会在最终结果里 extend 列表元素 [WIP]新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 Nov 30, 2018

@codecov

This comment has been minimized.

Copy link

codecov bot commented Nov 30, 2018

Codecov Report

Merging #147 into develop will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           develop   #147   +/-   ##
======================================
  Coverage      100%   100%           
======================================
  Files           20     20           
  Lines          527    527           
  Branches        80     81    +1     
======================================
  Hits           527    527
Impacted Files Coverage Δ
pypinyin/core.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6562604...40942d7. Read the comment docs.

howl-anderson added some commits Nov 30, 2018

@mozillazg mozillazg self-requested a review Dec 2, 2018

@mozillazg

This comment has been minimized.

Copy link
Owner

mozillazg commented Dec 2, 2018

@howl-anderson Thanks for your PR! 待我有空的时候看一下。

@mozillazg mozillazg changed the base branch from master to develop Dec 2, 2018

@mozillazg

This comment has been minimized.

Copy link
Owner

mozillazg commented Dec 2, 2018

@howl-anderson 麻烦 rebase 一下 develop 分支的代码,CI 中依赖的 coveralls 有点问题会导致 CI 失败,已经在 develop 分支中删除 coveralls 依赖。

@howl-anderson howl-anderson changed the title [WIP]新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 新特性:errors 为 callable 对象,返回值为 list 时将会在最终结果里 extend 列表元素 Dec 2, 2018

@howl-anderson

This comment has been minimized.

Copy link
Contributor

howl-anderson commented Dec 2, 2018

@howl-anderson 麻烦 rebase 一下 develop 分支的代码,CI 中依赖的 coveralls 有点问题会导致 CI 失败,已经在 develop 分支中删除 coveralls 依赖。

Done!

@mozillazg

This comment has been minimized.

Copy link
Owner

mozillazg commented Dec 5, 2018

@howl-anderson Thanks for your contribution. I'll release new version soon.

@mozillazg mozillazg merged commit b1cfafd into mozillazg:develop Dec 5, 2018

9 checks passed

ci/circleci: pypy2 Your tests passed on CircleCI!
Details
ci/circleci: pypy3 Your tests passed on CircleCI!
Details
ci/circleci: python2.7 Your tests passed on CircleCI!
Details
ci/circleci: python3.4 Your tests passed on CircleCI!
Details
ci/circleci: python3.5 Your tests passed on CircleCI!
Details
ci/circleci: python3.6 Your tests passed on CircleCI!
Details
ci/circleci: python3.7 Your tests passed on CircleCI!
Details
codecov/patch 100% of diff hit (target 100%)
Details
codecov/project 100% (+0%) compared to 6562604
Details
@mozillazg

This comment has been minimized.

Copy link
Owner

mozillazg commented Dec 8, 2018

@howl-anderson 最新 0.34.0 版本的 pypinyin 已包含这个 PR 的改动。

@howl-anderson

This comment has been minimized.

Copy link
Contributor

howl-anderson commented Dec 8, 2018

@mozillazg Awesome! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment