mirror of
https://github.com/python/cpython.git
synced 2026-05-28 21:30:59 +00:00
NEEDS DOC CHANGES. This one surprised me! While I expected tuple() to be a no-brainer, turns out it's actually dripping with consequences: 1. It will *allow* the popular PySequence_Fast() to work with any iterable object (code for that not yet checked in, but should be trivial). 2. It caused two std tests to fail. This because some places used PyTuple_Sequence() (the C spelling of tuple()) as an indirect way to test whether something *is* a sequence. But tuple() code only looked for the existence of sq->item to determine that, and e.g. an instance passed that test whether or not it supported the other operations tuple() needed (e.g., __len__). So some things the tests *expected* to fail with an AttributeError now fail with a TypeError instead. This looks like an improvement to me; e.g., test_coercion used to produce 559 TypeErrors and 2 AttributeErrors, and now they're all TypeErrors. The error details are more informative too, because the places calling this were *looking* for TypeErrors in order to replace the generic tuple() "not a sequence" msg with their own more specific text, and AttributeErrors snuck by that. |
||
|---|---|---|
| .. | ||
| test___all__ | ||
| test___future__ | ||
| test_al | ||
| test_array | ||
| test_asynchat | ||
| test_atexit | ||
| test_audioop | ||
| test_augassign | ||
| test_bastion | ||
| test_binascii | ||
| test_binhex | ||
| test_bisect | ||
| test_bsddb | ||
| test_bufio | ||
| test_builtin | ||
| test_capi | ||
| test_cd | ||
| test_cfgparser | ||
| test_cgi | ||
| test_charmapcodec | ||
| test_cl | ||
| test_class | ||
| test_cmath | ||
| test_coercion | ||
| test_compare | ||
| test_compile | ||
| test_complex | ||
| test_contains | ||
| test_cookie | ||
| test_copy_reg | ||
| test_cpickle | ||
| test_crypt | ||
| test_dbm | ||
| test_difflib | ||
| test_dl | ||
| test_doctest | ||
| test_dospath | ||
| test_dumbdbm | ||
| test_errno | ||
| test_exceptions | ||
| test_extcall | ||
| test_fcntl | ||
| test_file | ||
| test_fnmatch | ||
| test_fork1 | ||
| test_format | ||
| test_funcattrs | ||
| test_future | ||
| test_gc | ||
| test_gdbm | ||
| test_getopt | ||
| test_gettext | ||
| test_gl | ||
| test_global | ||
| test_grammar | ||
| test_grp | ||
| test_gzip | ||
| test_hash | ||
| test_httplib | ||
| test_imageop | ||
| test_imgfile | ||
| test_import | ||
| test_inspect | ||
| test_iter | ||
| test_largefile | ||
| test_linuxaudiodev | ||
| test_locale | ||
| test_long | ||
| test_longexp | ||
| test_mailbox | ||
| test_math | ||
| test_md5 | ||
| test_mimetools | ||
| test_MimeWriter | ||
| test_minidom | ||
| test_mmap | ||
| test_new | ||
| test_nis | ||
| test_ntpath | ||
| test_opcodes | ||
| test_openpty | ||
| test_operations | ||
| test_operator | ||
| test_parser | ||
| test_pickle | ||
| test_pkg | ||
| test_poll | ||
| test_popen2 | ||
| test_posixpath | ||
| test_pow | ||
| test_pty | ||
| test_pwd | ||
| test_pyexpat | ||
| test_re | ||
| test_regex | ||
| test_rfc822 | ||
| test_rgbimg | ||
| test_richcmp | ||
| test_rotor | ||
| test_sax | ||
| test_scope | ||
| test_select | ||
| test_sha | ||
| test_signal | ||
| test_socket | ||
| test_sre | ||
| test_strftime | ||
| test_string | ||
| test_StringIO | ||
| test_strop | ||
| test_struct | ||
| test_sunaudiodev | ||
| test_sundry | ||
| test_symtable | ||
| test_thread | ||
| test_threadedtempfile | ||
| test_time | ||
| test_timing | ||
| test_tokenize | ||
| test_traceback | ||
| test_types | ||
| test_ucn | ||
| test_unicode | ||
| test_unicodedata | ||
| test_unpack | ||
| test_urllib | ||
| test_urlparse | ||
| test_userdict | ||
| test_userlist | ||
| test_userstring | ||
| test_wave | ||
| test_weakref | ||
| test_winreg | ||
| test_winsound | ||
| test_xmllib | ||
| test_xreadline | ||
| test_zipfile | ||
| test_zlib | ||