{{sellerTotalView > 1 ? __("sellers", {number: sellerTotalView}) : __("seller", {number: sellerTotalView}) }}, {{numTotalView > 1 ? __("items", {number: numTotalView}) : __("item", {number: numTotalView}) }}
free FREE

Change Your Zip Code

Inventory information and delivery speeds may vary for different locations.

Location History

{{email ? __('Got it!') : __('Restock Alert')}}

We will notify you by email when the item back in stock.

Cancel
Yami

Jingdong book

编写高质量代码:改善Python程序的91个建议

{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}

编写高质量代码:改善Python程序的91个建议

{{__(":people-members", {'people': item.limit_people_count})}} {{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ item.invalid_price }} {{ itemDiscount }}
Ends in
{{ itemCurrency }}{{ item.valid_price }}
{{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }}
{{ itemDiscount }}
{{ itemCurrency }}{{ item.valid_price }} {{ itemCurrency }}{{ priceFormat(item.valid_price / item.bundle_specification) }}/{{ item.unit }} {{ itemCurrency }}{{ item.invalid_price }} {{itemDiscount}}
{{ itemCurrency }}{{ item.valid_price }}
Sale ends in
Sale will starts after Sale ends in
{{ getSeckillDesc(item.seckill_data) }}
{{ __( "Pay with Gift Card to get sale price: :itemCurrency:price", { 'itemCurrency' : itemCurrency, 'price' : (item.giftcard_price ? priceFormat(item.giftcard_price) : '0.00') } ) }} ({{ itemCurrency }}{{ priceFormat(item.giftcard_price / item.bundle_specification) }}/{{ item.unit }}) Details
Best before

Currently unavailable.

We don't know when or if this item will be back in stock.

Unavailable in your area.
Sold Out

Details

Full product details
Editer Recommend

从基本原则、惯用法、语法、库、设计模式、内部机制、开发工具和性能优化8方面深入探讨编写高质量Python代码的技巧、禁忌和实践。


延伸阅读:

利用Python进行数据分析
Effective JavaScript:编写高质量JavaScript代码的68个有效方法
Effective Objective-C 2.0:编写高质量iOS与OS X代码的52个有效方法
编写高质量代码:改善Java程序的151个建议

更多精彩,点击进入华章品牌店查阅>>


Content Description

在通往“Python技术殿堂”的路上,本书将为你编写健壮、优雅、高质量的Python代码提供切实帮助!内容全部由Python编码的实践组成,从基本原则、惯用法、语法、库、设计模式、内部机制、开发工具和性能优化8个方面深入探讨了编写高质量Python代码的技巧与禁忌,一共总结出91条宝贵的建议。每条建议对应Python程序员可能会遇到的一个问题。本书不仅以建议的方式从正反两方面给出了被实践证明为十分优秀的解决方案或非常糟糕的解决方案,而且分析了问题产生的根源,会使人有一种醍醐灌顶的感觉,豁然开朗。
《编写高质量代码:改善Python程序的91个建议》针对每个问题所选择的应用场景都非常典型,给出的建议也都与实践紧密结合。书中的每一条建议都可能在你的下一行代码、下一个应用或下一个项目中显露锋芒。建议你将本书搁置在手边,随时查阅,相信这么做一定能使你的学习和开发工作事半功倍。

Author Description

张颖,资深软件开发工程师,精通Java、Python、Perl等技术,以及多种脚本语言,有多年开发经验。曾就职于阿尔卡特朗讯上海公司的LTE无线事业部,现就职于IBM CSTL,工作期间获得过多种奖励,并于2012年获得一项云计算相关的专利。


赖勇浩,资深软件开发工程师,自2006年起以编写Python代码为生,现已创业。在Python领域有深厚的积累,CSDN博客专家,博客浏览量超过200万。也是珠三角技术沙龙创始人之一,从2009年起担任沙龙组委,长年活跃在社区第一线,在国内Python圈子里有较高的知名度和影响力。有超过7年的游戏开发经验,擅长Python、C++等网游相关的技术,曾就职于网易等网游研发厂商;现专注于中国彩票事业,开发互联网、电话和自助终端彩票销售平台,以促进行业信息化为己任。

Catalogue

前言
第1章引论 1
建议1:理解Pythonic概念 1
建议2:编写Pythonic代码 5
建议3:理解Python与C语言的不同之处 8
建议4:在代码中适当添加注释 10
建议5:通过适当添加空行使代码布局更为优雅、合理 12
建议6:编写函数的4个原则 15
建议7:将常量集中到一个文件 18


第2章编程惯用法 20
建议8:利用assert语句来发现问题 20
建议9:数据交换值的时候不推荐使用中间变量 22
建议10:充分利用Lazy evaluation的特性 24
建议11:理解枚举替代实现的缺陷 25
建议12:不推荐使用type来进行类型检查 27
建议13:尽量转换为浮点类型后再做除法 29
建议14:警惕eval()的安全漏洞 31
建议15:使用enumerate()获取序列迭代的索引和值 33
建议16:分清==与is的适用场景 35
建议17:考虑兼容性,尽可能使用Unicode 37
建议18:构建合理的包层次来管理module 42


第3章基础语法 45
建议19:有节制地使用from...import语句 45
建议20:优先使用absolute import来导入模块 48
建议21:i+=1不等于++i 50
建议22:使用with自动关闭资源 50
建议23:使用else子句简化循环(异常处理) 53
建议24:遵循异常处理的几点基本原则 55
建议25:避免finally中可能发生的陷阱 59
建议26:深入理解None,正确判断对象是否为空 60
建议27:连接字符串应优先使用join而不是+ 62
建议28:格式化字符串时尽量使用.format方式而不是% 64
建议29:区别对待可变对象和不可变对象 68
建议30:[]、()和{}:一致的容器初始化形式 71
建议31:记住函数传参既不是传值也不是传引用 73
建议32:警惕默认参数潜在的问题 77
建议33:慎用变长参数 78
建议34:深入理解str()和repr()的区别 80
建议35:分清staticmethod和classmethod的适用场景 82


第4章库 86
建议36:掌握字符串的基本用法 86
建议37:按需选择sort()或者sorted() 89
建议38:使用copy模块深拷贝对象 92
建议39:使用Counter进行计数统计 95
建议40:深入掌握ConfigParser 97
建议41:使用argparse处理命令行参数 99
建议42:使用pandas处理大型CSV文件 103
建议43:一般情况使用ElementTree解析XML 107
建议44:理解模块pickle优劣 111
建议45:序列化的另一个不错的选择——JSON 113
建议46:使用traceback获取栈信息 116
建议47:使用logging记录日志信息 119
建议48:使用threading模块编写多线程程序 122
建议49:使用Queue使多线程编程更安全 125


第5章设计模式 129
建议50:利用模块实现单例模式 129
建议51:用mixin模式让程序更加灵活 132
建议52:用发布订阅模式实现松耦合 134
建议53:用状态模式美化代码 137


第6章内部机制 141
建议54:理解built-in objects 141
建议55:__init__()不是构造方法 143
建议56:理解名字查找机制 147
建议57:为什么需要self参数 151
建议58:理解MRO与多继承 154
建议59:理解描述符机制 157
建议60:区别__getattr__()和__getattribute__()方法 160
建议61:使用更为安全的property 164
建议62:掌握metaclass 169
建议63:熟悉Python对象协议 176
建议64:利用操作符重载实现中缀语法 179
建议65:熟悉 Python 的迭代器协议 181
建议66:熟悉 Python 的生成器 185
建议67:基于生成器的协程及greenlet 188
建议68:理解GIL的局限性 192
建议69:对象的管理与垃圾回收 194


第7章使用工具辅助项目开发 197
建议70:从PyPI安装包 197
建议71:使用pip和yolk安装、管理包 199
建议72:做paster创建包 202
建议73:理解单元测试概念 209
建议74:为包编写单元测试 212
建议75:利用测试驱动开发提高代码的可测性 216
建议76:使用Pylint检查代码风格 218
建议77:进行高效的代码审查 221
建议78:将包发布到PyPI 224


第8章性能剖析与优化 227
建议79:了解代码优化的基本原则 227
建议80:借助性能优化工具 228
建议81:利用cProfile定位性能瓶颈 229
建议82:使用memory_profiler 和 objgraph 剖析内存使用 235
建议83:努力降低算法复杂度 237
建议84:掌握循环优化的基本技巧 238
建议85:使用生成器提高效率 240
建议86:使用不同的数据结构优化性能 243
建议87:充分利用set的优势 245
建议88:使用multiprocessing克服GIL的缺陷 248
建议89:使用线程池提高效率 254
建议90:使用C/C++模块扩展提高性能 257
建议91:使用 Cython 编写扩展模块 259

Book Abstract

第4章

Python具有丰富的库,掌握所有的库的用法和使用基本上是不可能的,更好的方法是掌握一些常见库的使用和注意事项,对于使用较少的库可以在具体应用时参考其文档以及使用范例。本章主要讨论一些常用库的使用和技巧。
建议36:掌握字符串的基本用法
无名氏说:编程有两件事,一件是处理数值,另一件是处理字符串。要我说,对于商业应用编程来说,处理字符串的代码可能超过八成,所以掌握字符串的基本用法尤其重要。通过Python教程,读者已经掌握了基本的字符串字面量语法,比如u、r前缀等,但对于怎么更好地编写多行的字符串字面量,仍然有个小技巧值得向大家推介。
>>> s = ('SELECT * '
... 'FROM atable '
... 'WHERE afield="value"')
>>> s
'SELECT * FROM atable WHERE afield="value"'
这就是利用Python遇到未闭合的小括号时会自动将多行代码拼接为一行和把相邻的两个字符串字面量拼接在一起的特性做到的。相比使用3个连续的单(双)引号,这种方式不会把换行符和前导空格也当作字符串的一部分,则更加符合用户的思维习惯。
除了这个小技巧,也许你已经听说过Python中的字符串其实有str和unicode两种。是的,的确如此,虽然在Python 3中已经简化为一种,但如果你还在编写运行在Python 2上的程序,当需要判断变量是否为字符串时,需要注意了。判断一个变量s是不是字符串应使用isinstance(s,basestring),注意这里的参数是basestring而不是str。
>>> a = "hi"
>>> isinstance(a,str) ... ... ... ①
True
>>> b =u"Hi"
>>> isinstance(b,str) ... ... ... ②
False
>>> isinstance(b,basestring)
True
>>> isinstance(b,unicode)
True
>>> isinstance(a,unicode) ... ... ... ③
False
>>>
如标注①所示:isinstance(a,str)用于判断一个字符串是不是普通字符串,也就是说其类型是否为str;因此当被判断的字符串为Unicode的时候,返回False,如标注②所示。同样,标注③中isinstance(a,unicode)用来判断一个字符串是不是Unicode。因此要正确判断一个变量是不是字符串,应该使用isinstance(s,basestring),因为basestring才是是str和unicode的基类,包含了普通字符串和unicode类型。
接下来正式开始学习字符串的基本用法。与其他书籍、手册不同,我们将通过性质判定、查找替换、分切与连接、变形、填空与删减等5个方面来学习。首先是性质判定,str对象有以下几个方法:isalnum()、isalpha()、isdigit()、islower()、isupper()、isspace()、istitle()、startswith(prefix[, start[, end]])、endswith(suffix[,start[, end]]),前面几个is*()形式的函数很简单,顾名思义无非是判定是否数字、字母、大小写、空白符之类的,istitle()作为东方人用得少些,它是判定字符串是否每个单词都有且只有第一个字母是大写的。
>>> assert 'Hello World!'.istitle() == True
>>> assert 'HEllo World!'.istitle() == False
相对于is*()这些“小儿科”来说,需要注意的是*with()函数族可以接受可选的start、end参数,善加利用,可以优化性能。另外,自Python 2.5版本起,*with()函数族的prefix参数可以接受tuple类型的实参,当实参中的某个元素能够匹配时,即返回True。
接下来是查找与替换,count( sub[, start[, end]])、find( sub[, start[, end]])、index( sub[, start[, end]])、rfind( sub[, start[,end]])、rindex( sub[, start[, end]])这些方法都接受start、end参数,善加利用,可以优化性能。其中count()能够查找子串sub在字符串中出现的次数,这个数值在调用replace方法的时候用得着。此外,需要注意find()和index()方法的不同:find()函数族找不到时返回-1,index()函数族则抛出ValueError异常。但对于判定是否包含子串的判定并不推荐调用这些方法,而是推荐使用in和not in操作符。
>>> str = "Test if a string contains some special substrings"
>>> if str.find("some") != -1: #使用find 方法进行判断
... print "Yes,it contains"
...
Yes,it contains
>>> if "some" in str: #使用in方法也可以判断
... print "Yes,it contains using in"
...
Yes,it contains using in
replace(old, new[,count])用以替换字符串的某些子串,如果指定count参数的话,就最多替换count次,如果不指定,就全部替换(跟其他语言不太一样,要注意了)。
然后要掌握字符串的分切与连接,关于连接,会有一节专门进行讲述,在这里,专讲分切。partition(sep)、rpartition(sep)、splitlines([keepends])、split([sep [,maxsplit]])、 rsplit([sep[,maxsplit]]),别看这些方法好像很多,其实只要弄清楚partition()和split()就可以了。*partition()函数族是2.5版本新增的方法,它接受一个字符串参数,并返回一个3个元素的元组对象。如果sep没出现在母串中,返回值是(sep, '','');否则,返回值的第一个元素是sep左端的部分,第二个元素是sep自身,第三个元素是sep右端的部分。而split()的参数maxsplit是分切的次数,即最大的分切次数,所以返回值最多有maxsplit+1个元素。但split()有不少小陷阱,需要注意,比如对于字符串s、s.split()和s.split('')的返回值是不相同的。
>>> ' hello world!'.split()
['hello', 'world!']
>>> ' hello world!'.split(' ')
['', '', 'hello', '', '', 'world!']
产生差异的原因在于:当忽略sep参数或sep参数为None时与明确给sep赋予字符串值时,split()采用两种不同的算法。对于前者,split()先去除字符串两端的空白符,然后以任意长度的空白符串作为界定符分切字符串(即连续的空白符串被当作单一的空白符看待);对于后者则认为两个连续的sep之间存在一个空字符串。因此对于空字符串(或空白符串),它们的返回值也是不同的。
>>> ''.split()
[]
>>> ''.split(' ')
['']
掌握了split(),可以说字符串最大的陷阱已经跨过去了。下面是关于变形的内容。lower()、upper()、capitalize()、swapcase()、title()这些无非是大小写切换的小事,不过需要注意的是titile()的功能是将每一个单词的首字母大写,并将单词中的非首字母转换为小写(英文文章的标题通常是这种格式)。
>>> 'hello wORld!'.title()
'Hello World!'
因为title()函数并不去除字符串两端的空白符也不会把连续的空白符替换为一个空格,所以不能把title()理解先以空白符分切字符串,然后调用capitalize()处理每个字词以使其首字母大写,再用空格将它们连接在一起。如果你有这样的需求,建议使用string模块中的capwords(s)函数,它能够去除两端的空白符,再将连续的空白符用一个空格代替。
>>> ' hello world!'.title()
' Hello World!'
>>> string.capwords(' hello world!')
'Hello World!'
看,它们的结果是不相同的!最后,是删减与填充。删减在文本处理是很常用,我们常常得把字符串掐头去尾,就用得上它们。如果strip([chars])、lstrip([chars])、rstrip([chars])中的chars参数没有指定,就是删除空白符,空白符由string.whitespace常量定义。填充则常用于字符串的输出,借助它们能够排出漂亮的版面。center(width[, fillchar])、ljust(width
[, fillchar])、rjust(width[, fillchar])、zfill(width)、expandtabs([tabsize]),看,有了它们,居中、左对齐、右对齐什么的完全不在话下,这些方法中的fillchar参数是指用以填充的字符,默认是空格。而zfill()中的z是指zero,所以顾名思义,zfill()即是以字符0进行填充,在输出数值时比较常用。expandtabs()的tabsize参数默认为8,它的功能是把字符串中的制表符(tab)转换为适当数量的空格。
建议37:按需选择sort()或者sorted()
各种排序算法以及它们的时间复杂度分析是很多企业面试人员在面试时候经常会问到的问题,这也不难理解,在实际的应用过程中确实会遇到各种需要排序的情况,如按照字母表输出一个序列、对记录的多个字段排序等。还好,Python中的排序相对简单,常用的函数有sort()和sorted()两种。这两种函数并不完全相同,各有各的用武之地。我们来具体分析一下。
1)相比于sort(),sorted()使用的范围更为广泛,两者的函数形式分别如下:
sorted(iterable[, cmp[, key[, reverse]]])
s.sort([cmp[, key[, reverse]]])
这两个方法有以下3个共同的参数:
cmp为用户定义的任何比较函数,函数的参数为两个可比较的元素(来自iterable或者list),函数根据第一个参数与第二个参数的关系依次返回-1、0或者+1(第一个参数小于第二个参数则返回负数)。该参数默认值为None。
key是带一个参数的函数,用来为每个元素提取比较值,默认为None(即直接比较每个元素)。
reverse表示排序结果是否反转。
>>> persons = [{'name': 'Jon', 'age': 32}, {'name': 'Alan', 'age': 50}, {'name':
'Bob', 'age': 23}]
>>> sorted(persons, key=lambda x: (x['name'], -x['age']))
[{'age': 50, 'name': 'Alan'}, {'age': 23, 'name': 'Bob'}, {'age': 32, 'name': 'J
on'}]
从函数的定义形式可以看出,sorted()作用于任意可迭代的对象,而sort()一般作用于列表。因此下面的例子中针对元组使用sort()方法会抛出AttributeError,而使用sorted()函数则没有这个问题。
>>> a = (1,2,4,2,3)
>>> a.sort()
Traceback (most recent call last):
File " ", line 1, in
AttributeError: 'tuple' object has no attribute 'sort'
>>> sorted(a)
[1, 2, 2, 3, 4]

……

Introduction

为什么要写这本书
当这本书的写作接近尾声的时候,回过头来看看这一年多的写作历程,不由得心生感叹,这是一个痛并快乐着的过程。不必说牺牲了多少个周末,也不必计算多少个夜晚伏案写作,单是克服写作过程中因疲劳而迸发出来的彷徨、犹豫和动摇等情绪都觉得是件不容易的事情。但不管怎么说,这最终是个沉淀和收获的过程,写作的同时我也和读者们一样在进步。为什么要写这本书?可以说是机缘巧合。机械工业出版社的杨福川老师联系到我,说他们打算策划一本关于高质量Python编程方面的书籍,问我有没有兴趣加入。实话实说,最开始我是持否定态度的,一则因为业余时间实在有限,无法保证我“工作和生活要平衡”的理念;二则觉得自己水平有限,在学习Python的道路上我和千千万万读者一样,只是一个普通的“朝圣者”,我也有迷惑不解的时候,在没有修炼到大彻大悟之前拿什么来给人传道授业?是赖勇浩老师的加入给我注入了一针强心剂,他丰富的Python项目经验以及长期活跃于Python社区所积累下来的名望无形中给了我一份信心。杨老师的鼓励和支持也更加坚定了我的态度,经过反复考虑和调整自己的心态,最终我决定和赖老师一起完成这本书。因为我也经历过从零开始的Python学习过程,我也遇到过各种困惑,经历过不同的曲折,这些可能也正是每一个学习Python的人从最初到进阶这一过程中都会遇到的问题。抱着分享自己在学习和工作中所积累的一点微薄经验的心态,我开始了本书的写作之旅。这个过程也被我当作是对自己学过的知识的一种梳理。如果与此同时,还能够给读者带来一些启示和思索,那将是这本书所能带给我的最大收获了。
读者对象
有一定的Python基础,希望通过项目最佳实践来提升自己的相关Python人员。
希望进一步掌握Python相关内部机制的技术人员。
希望写出更高质量、更Pythonic代码的编程人员。
开设相关课程的大专院校师生。
如何阅读本书
首先需要注意的是,本书并不是入门级的语法介绍类的书籍,因此在阅读本书之前假定你已经掌握了最基础的Python语法。如果没有,也没有关系,你可以先找一本最简单的介绍Python语法的书籍看看,尝试写几个Python小程序之后再来阅读本书。
本书分为8章,主要从编程惯用法、基础语法、库、设计模式、内部机制、开发工具、性能剖析与优化等方面解读如何编写高质量的Python程序。每个章节的内容都以建议的形式呈现,这些建议或源于实际项目应用经验,或源于对Python本质的理解和探讨,或源于社区推荐的做法。它们能够帮助读者快速完成从入门到进阶的这个过程。
由于各个章节相对独立,因此无须花费整段的时间从头开始阅读。你可以在空闲的时候选取任意感兴趣的小节阅读。为了减轻读者负担,本书代码尽量保持完整,阅读过程中无须额外下载其他相关代码。
勘误和支持
由于作者的水平有限,加之编写时间仓促,书中难免会出现一些错误或者不准确的地方,恳请读者批评指正。如果你在阅读过程中遇到任何问题或者发现任何错误,欢迎发送邮件至邮箱,我们会尽量一一解答直到你满意。期待能够得到你的真挚反馈。
致谢
首先要感谢机械工业出版社华章公司的杨福川老师,因为有了你的鼓励才使我有勇气开始这本书。还要感谢机械工业出版社的孙海亮编辑,在这一年多的时间中始终支持我的写作,是你的鼓励和帮助引导我顺利完成全部书稿。当然也要感谢我的搭档赖老师,和你合作是一件非常愉快的事情,也让我收获颇多。
其次要感谢我的家人,是你们的宽容、支持和理解给了我完成本书的动力,也是你们无微不至的照顾让我不必为生活中的琐事烦心,从而能全身心地投入到写作中去。
最后,我想提前感谢一下本书的读者,谢谢你们能够选择阅读这本书,这将是作为作者的我们最大的荣幸。
谨以此书献给所有热爱Python的朋友们!
张颖



Specifications

Brand Jingdong book
Brand Origin China

Disclaimer

Product packaging, specifications and price are subject to change without notice. All information about the products on our website is provided for information purposes only. Please always read labels, warnings and directions provided with the product before use.

View Full Terms of Use
Add to favorites
{{ $isZh ? coupon.coupon_name_sub : coupon.coupon_ename_sub | formatCurrency }}
{{__("Buy Directly")}} {{ itemCurrency }}{{ item.directly_price }}
Quantity
{{ quantity }}
{{ instockMsg }}
{{ limitText }}
{{buttonTypePin == 3 ? __("Scan to view more PinGo") : __("Scan to start")}}
Sold by JD@CHINA
Ship to
{{ __("Ship to United States only") }}
Free shipping over 69
Genuine guarantee

Added to Cart

Keep Shopping

More to Consider

{{ item.brand_name }}

{{ item.item_name }}

{{ item.currency }}{{ item.market_price }}

{{ item.currency }}{{ item.unit_price }}

{{ item.currency }}{{ item.unit_price }}

Coupons

{{ coupon.coupon_name_new | formatCurrency }}
Clip Clipped Over
{{ getCouponDescStr(coupon) }}
{{ coupon.use_time_desc }}
Expires soon {{ formatTime(coupon.use_end_time) }}

Share this item with friends

Cancel

Yami Gift Card

Get this exclusive deal when paying with gift card

Terms and Conditions

Gift card deals are special offers for selected products;

The gift card deals will automatically be activated if a customer uses gift card balance at check out and the balance is sufficient to pay for the total price of the shopping cart products with gift card deals;

You will not be able to activate the gift card deals if you choose other payment methods besides gift card. The products will be purchased at their normal prices;

If your account balance is not enough to pay for the products with gift card deals, you can choose to reload your gift card balance by clicking on the Reload button at either shopping cart page or check out page;

Products that have gift card deals can be recognized by a special symbol showing 'GC Deal';

For any additional questions or concerns, please contact our customer service;

Yamibuy reserves the right of final interpretation.

Sold by Yami

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

Yami is committed to provide our customers with a peace of mind when purchasing from us. Most items shipped from Yamibuy.com can be returned within 30 days of receipt of shipment (For Food, Beverages, Snacks, Dry Goods, Health supplements, Fresh Grocery and Perishables Goods, within 7 days of receipt of shipment due to damages or quality issues; To ensure that every customer receives safe and high-quality products, we do not provide refunds or returns for beauty products once they have been opened or used, except in the case of quality issues; Some products may have different policies or requirements associated with them, please see below for products under special categories, or contact Yami Customer Service for further assistance).
Thank you for your understanding and support.

Learn More

Sold by Yami

Terms and Conditions of Yami E-Gift Card

If you choose “Redeem automatically” as your delivery method, your gift card balance will be reload automatically after your order has been processed successfully;

If you choose “Send to Email”as your delivery method, the card number and CVV will be sent to the email address automatically;

Any user can use the card number and CVV to redeem the gift card, please keep your gift card information safely. If you have any trouble receiving email, please contact Yami customer service;

Yami gift card can be used to purchase both Yami owned or Marketplace products;

Yami gift card will never expire;

Yami gift card balance does not have to be used up at once;

All rights reserved by Yami.

Return Policy

Gift card that has already been consumed is non-refundable.

Sold by JD@CHINA

Service Guarantee

Yami Free Shipping over $49
Yami Easy Returns
Yami Ships from United States

Shipping

  • United States

    Standard Shipping is $5.99 (Excluding Alaska & Hawaii). Free on orders of $49 or more.

    Local Express is $5.99 (Available in Parts of CA, NJ, MA & PA). Free on orders of $49 or more.

    2-Day Express (Includes Alaska & Hawaii) starts at $19.99.

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Sold by JD@CHINA

Service Guarantee

Yami Cross-store Free Shipping over $69
Yami 30-days Return

Yami-China FC

Yami has a consolidation warehouse in China which collects multiple sellers’ packages and combines to one order. Our Yami consolidation warehouse will directly ship the packages to your door. Cross-store free shipping over $69.

Return Policy

You may return products within 30 days upon receiving the products. Sellers take responsibilities for any wrong shipment or missing items. Packing needs to be unopened for any other than quality issues return. We promise to pack carefully, but because goods are taking long journey to destinations, simple damages to packaging may occur. Any damages not causing internal goods quality problems are not allowed to return. If you open the package and any quality problem is found, please contact customer service within three days after receipt of goods.

Shipping Information

Yami Consolidation Service Shipping Fee $9.99(Free shipping over $69)

Sellers in China will ship their orders within 1-2 business days once the order is placed. Packages are sent to our consolidation warehouse in China and combined there. Our Yami consolidation warehouse will directly ship the packages to you via UPS. The average time for UPS to ship from China to the United States is about 10 working days and it can be traced using the tracking number. Due to the pandemic, the delivery time may be delayed by about 5 days. The package needs to be signed by the guest. If the receipt is not signed, the customer shall bear the risk of loss of the package.

Sold by JD@CHINA

Service Guarantee

Free shipping over 69
Genuine guarantee

Shipping

Yami Consolidated Shipping $9.99(Free shipping over $69)


Seller will ship the orders within 1-2 business days. The logistics time limit is expected to be 7-15 working days. In case of customs clearance, the delivery time will be extended by 3-7 days. The final receipt date is subject to the information of the postal company.

Yami Points information

All items are excluding from any promotion or points events on Yamibuy.com

Return Policy

You may return product within 30 days upon receiving the product. Items returned must be new in it's original packing, including the original invoice for the purchase. Customer return product at their own expense.

Yami

Download the Yami App

Back Top

Recommended for You

About the brand

Jingdong book

为您推荐

Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折
Yami
欣葉
2种选择
欣叶 御大福 芋头麻薯 180g

周销量 600+

$1.66 $1.99 83折

Reviews{{'('+ commentList.posts_count + ')'}}

Have your say. Be the first to help other guests.

Write a review
{{ totalRating }} Write a review
  • {{i}} star

    {{i}} stars

    {{ parseInt(commentRatingList[i]) }}%

Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}
Yami Yami
{{ comment.user_name }}

{{ showTranslate(comment) }}Show Less

{{ strLimit(comment,800) }}Show more

Show Original

{{ comment.content }}

Yami
Show All

{{ formatTime(comment.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ comment.likes_count }} {{ comment.likes_count }} {{ comment.reply_count }} {{comment.in_user==uid ? __('Delete') : __('Report')}}

No related comment~

Review

Yami Yami

{{ showTranslate(commentDetails) }}Show Less

{{ strLimit(commentDetails,800) }}Show more

Show Original

{{ commentDetails.content }}

Yami
Show All

{{ formatTime(commentDetails.in_dtm) }} VERIFIED PURCHASE {{groupData}}

{{ commentDetails.likes_count }} {{ commentDetails.likes_count }} {{ commentDetails.reply_count }} {{commentDetails.in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Comments{{'(' + replyList.length + ')'}}

Yami Yami

{{ showTranslate(reply) }}Show Less

{{ strLimit(reply,800) }}Show more

Show Original

{{ reply.reply_content }}

{{ formatTime(reply.reply_in_dtm) }}

{{ reply.reply_likes_count }} {{ reply.reply_likes_count }} {{ reply.reply_reply_count }} {{reply.reply_in_user==uid ? __('Delete') : __('Report')}}

Please write at least one word

Cancel

That’s all the comments so far!

Write a review
How would you rate this item?

Please add your comment.

  • A nice nickname will make your comments more popular!
  • The nickname in your account will be changed to the same as here.
Thanks for your review
Our community rely on great reviews like yours to find the best of Asia.

Report

If you find this content inappropriate and think it should be removed from the Yami.com site, let us know please.

Cancel

Are you sure to delete your review?

Cancel

You’ve Recently Viewed

About the brand

Jingdong book