summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_str.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue 6089: str.format raises SystemError.Eric Smith2009-05-231-0/+4
|
* Issue 5237, Allow auto-numbered replacement fields in str.format() strings.Eric Smith2009-03-141-3/+33
| | | | | | | | | | | | | | | | | For simple uses for str.format(), this makes the typing easier. Hopfully this will help in the adoption of str.format(). For example: 'The {} is {}'.format('sky', 'blue') You can mix and matcth auto-numbering and named replacement fields: 'The {} is {color}'.format('sky', color='blue') But you can't mix and match auto-numbering and specified numbering: 'The {0} is {}'.format('sky', 'blue') ValueError: cannot switch from manual field specification to automatic field numbering Will port to 3.1.
* Preemptively backport the relevant parts of r65420Antoine Pitrou2008-08-021-0/+3
|
* Moved testing of builtin types out of test_builtin and into type specific ↵Benjamin Peterson2008-05-031-0/+14
| | | | modules
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+258
| | | | | | | | | | | | | | | Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).
* Prevent these tests from running on Win64 since they don\'t apply there eitherNeal Norwitz2007-06-111-1/+2
|
* Prevent expandtabs() on string and unicode objects from causing a segfault whenNeal Norwitz2007-06-091-0/+11
| | | | | | | a large width is passed on 32-bit platforms. Found by Google. It would be good for people to review this especially carefully and verify I don't have an off by one error and there is no other way to cause overflow.
* Make subclasses of int, long, complex, float, and unicode perform typeBrett Cannon2005-04-261-0/+63
| | | | | | | conversion using the proper magic slot (e.g., __int__()). Also move conversion code out of PyNumber_*() functions in the C API into the nb_* function. Applied patch #1109424. Thanks Walter Doewald.
* Move test_bug1001011() to string_tests.MixinStrUnicodeTest so thatWalter Dörwald2004-08-261-1/+2
| | | | | | it can be used for str and unicode. Drop the test for "".join([s]) is s because this is an implementation detail (and doesn't work for unicode)
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-3/+1
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Fix PyString_Format() so that '%c' % u'a' returns u'a'Walter Dörwald2003-03-311-0/+4
| | | | | | | | instead of raising a TypeError. (From SF patch #710127) Add tests to verify this is fixed. Add various tests for '%c' % int.
* Port all string tests to PyUnit and share as much testsWalter Dörwald2003-02-211-0/+23
between str, unicode, UserString and the string module as possible. This increases code coverage in stringobject.c from 83% to 86% and should help keep the string classes in sync in the future. From SF patch #662807