我正在试图弄清楚如何对列表进行排序,而且我已经遇到了我多年来一直绊倒的问题: 记录基本类型的方法在哪里?我可以在列表的sort()方法中找到的唯一 的东西在教程中 ,其中声明: sort() 对列表中的项目进行排序。 列表方法不会接受可调用的用作 比较功能? 文档中的那种东西在哪里?我已经查看了库参考, 语言参考,全局模块索引。 我已经想通了我可以做
I''m trying to figure out how to sort a list, and I''ve run into a problem that that I have tripped over constantly for years: where are the methods of basic types documented? The only thing I can find on a list''s sort() method is in the tutorial where it states: sort() Sort the items of the list, in place. Doesn''t the list method would accept a callable to be used as a comparison function? Where is that sort of thing in the documentation? I''ve looking in the library reference, the language reference, the global module index. I have figured out I can do
list.sort .__ doc __ list.sort.__doc__
' 'L.sort(cmpfunc = None) - 稳定排序* IN PLACE *; cmpfunc(x,y) - > -1,0,1'' - 格兰特爱德华兹格兰特哇!但他们在1953年左右去了MARS !! visi
''L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1'' -- Grant Edwards grante Yow! But they went to MARS at around 1953!! visi
推荐答案[格兰特爱德华兹] [Grant Edwards] 我正在试图弄清楚如何对列表进行排序,而且我遇到了一个问题,即我多年来一直绊倒的问题:基本类型的方法记录在哪里? 关于可变序列类型的方法记录在库 手册中关于可变序列类型的部分: docs.python/lib/typesseq-mutable.html 我可以在列表'sort()方法中找到的唯一内容是在教程中声明: I''m trying to figure out how to sort a list, and I''ve run into a problem that that I have tripped over constantly for years: where are the methods of basic types documented? The methods on mutable sequence types are documented in the Library manual''s section on mutable sequence types: docs.python/lib/typesseq-mutable.html The only thing I can find on a list''s sort() method is in the tutorial where it states:
您可以通过例如查找排序来找到上述内容。在 图书馆手册'的索引。
You could have found the above by, e.g., looking up "sort" in the Library manual''s index.
格兰特爱德华兹在2005-02-01 12:21对世界说: Grant Edwards said unto the world upon 2005-02-01 12:21: 我正在试图弄清楚如何对列表进行排序,而且我遇到了一个问题,即我多年来一直绊倒的问题:记录基本类型的方法?我可以在列表的sort()方法中找到的唯一的东西是在教程中其中声明: sort()对项目进行排序列表的位置。 列表方法是否会接受可调用的比较函数? 文档中的那种东西在哪里?我已经查看了库参考,语言参考,全局模块索引。 我发现我可以做到 I''m trying to figure out how to sort a list, and I''ve run into a problem that that I have tripped over constantly for years: where are the methods of basic types documented? The only thing I can find on a list''s sort() method is in the tutorial where it states: sort() Sort the items of the list, in place. Doesn''t the list method would accept a callable to be used as a comparison function? Where is that sort of thing in the documentation? I''ve looking in the library reference, the language reference, the global module index. I have figured out I can do list.sort .__ doc __ list.sort.__doc__
''L.sort(cmpfunc = None) - 稳定排序* IN PLACE *; cmpfunc(x,y) - > -1,0,1''
''L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1''
我不肯定我明白你在看什么for,但这些 帮助?: < www.python/doc/2.4/lib/built-in- funcs.html#l2h-15> < www.python/doc/2.4/lib/typesseq.html> < http: //www.python/doc/2.4/lib/typesseq-mutable.html> Best, Brian vdB
Hi, I''m not positive I understand what you are looking for, but do these help?: <www.python/doc/2.4/lib/built-in-funcs.html#l2h-15> <www.python/doc/2.4/lib/typesseq.html> <www.python/doc/2.4/lib/typesseq-mutable.html> Best, Brian vdB
Grant Edwards写道: Grant Edwards wrote: 我正在试图弄清楚如何对列表进行排序,我遇到了一个问题,那就是我经常绊倒多年:基本类型的方法记录在哪里?我可以在列表的sort()方法中找到的唯一的东西是在教程中其中声明: sort()对项目进行排序列表的位置。 列表方法是否会接受可调用的比较函数? 文档中的那种东西在哪里?我已经查看了库参考,语言参考,全局模块索引。 我发现我可以做到 I''m trying to figure out how to sort a list, and I''ve run into a problem that that I have tripped over constantly for years: where are the methods of basic types documented? The only thing I can find on a list''s sort() method is in the tutorial where it states: sort() Sort the items of the list, in place. Doesn''t the list method would accept a callable to be used as a comparison function? Where is that sort of thing in the documentation? I''ve looking in the library reference, the language reference, the global module index. I have figured out I can do list.sort .__ doc __ list.sort.__doc__
''L.sort(cmpfunc = None) - 稳定排序* IN PLACE *; cmpfunc(x,y) - > -1,0,1''
''L.sort(cmpfunc=None) -- stable sort *IN PLACE*; cmpfunc(x, y) -> -1, 0, 1''
格兰特, 快速,简短的文档字符串列表:>>>帮助(清单) wes
Grant, For a quick, short doc string list: >>> help(list) wes
更多推荐
列表方法在哪里记录?
发布评论