summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* SF patch 568629 by Oren Tirosh: types made callable.Guido van Rossum2002-06-141-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These built-in functions are replaced by their (now callable) type: slice() buffer() and these types can also be called (but have no built-in named function named after them) classobj (type name used to be "class") code function instance instancemethod (type name used to be "instance method") The module "new" has been replaced with a small backward compatibility placeholder in Python. A large portion of the patch simply removes the new module from various platform-specific build recipes. The following binary Mac project files still have references to it: Mac/Build/PythonCore.mcp Mac/Build/PythonStandSmall.mcp Mac/Build/PythonStandalone.mcp [I've tweaked the code layout and the doc strings here and there, and added a comment to types.py about StringTypes vs. basestring. --Guido]
* Use code.interact(), which is even simpler, *and* imports readlineGuido van Rossum2002-06-141-3/+3
| | | | when it can.
* Don't poorly emulate the interactive interpreter, useGuido van Rossum2002-06-141-19/+9
| | | | code.InteractiveConsole to do a much better job.
* Test for the bug in recurse_down_subclasses() that I just fixed.Guido van Rossum2002-06-141-0/+10
|
* Fix SF bug # 561858 Assertion with very long listsNeal Norwitz2002-06-141-0/+31
| | | | | Write 4 bytes for co_stacksize, etc. to prevent writing out bad .pyc files which can cause a crash when read back in.
* SF bug # 493951 string.{starts,ends}with vs slicesNeal Norwitz2002-06-141-0/+27
| | | | Handle negative indices similar to slices.
* Test exceptional condition in select()Neal Norwitz2002-06-131-0/+7
|
* Test exceptional conditions in list.sort()Neal Norwitz2002-06-131-0/+15
|
* Cleanup a littleNeal Norwitz2002-06-131-6/+7
|
* Fix for SF bug 532646. This is a little simpler than what NealGuido van Rossum2002-06-131-0/+14
| | | | | suggested there, based upon a better analysis (__getattr__ is a red herring). Will backport to 2.2.
* Temporarily disable the timeout and socket tests.Guido van Rossum2002-06-132-14/+14
| | | | | | They still run as standalone scripts, but when used as part of the regression test suite, they are effectively no-ops. (This is done by renaming test_main to main.)
* Hopefully this addresses the remaining issues of SF bugs 459235 andGuido van Rossum2002-06-131-0/+46
| | | | | | 473985. Through a subtle rearrangement of some members in the etype struct (!), mapping methods are now preferred over sequence methods, which is necessary to support str.__getitem__("hello", slice(4)) etc.
* The opcode FOR_LOOP no longer exists.Guido van Rossum2002-06-131-1/+0
|
* Extend dependency tracking so that .o files are rebuilt.Jeremy Hylton2002-06-131-4/+2
| | | | | | | | | | Two new tests are needed: Don't skip building an extension if any of the depends files are newer than the target. Pass ext.depends to compiler.compile() so that it can track individual files.
* Refactor compile() method implementations.Jeremy Hylton2002-06-135-272/+178
| | | | | | | | Always use _setup_compile() to do the grunt work of processing arguments, figuring out which files to compile, and emitting debug messages for files that are up-to-date. Use _get_cc_args() when possible.
* Add depends=None to the arglist for compile().Jeremy Hylton2002-06-131-1/+2
|
* Extend compiler() method with optional depends argument.Jeremy Hylton2002-06-131-74/+168
| | | | | | | | | | | | This change is not backwards compatible. If a compiler subclass exists outside the distutils package, it may get called with the unexpected keyword arg. It's easy to extend that compiler by having it ignore the argument, and not much harder to do the right thing. If this ends up being burdensome, we can change it before 2.3 final to work harder at compatibility. Also add _setup_compile() and _get_cc_args() helper functions that factor out much of the boilerplate for each concrete compiler class.
* Comment out testHostnameRes() -- it depends on a correctly workingGuido van Rossum2002-06-131-10/+10
| | | | DNS, and we can't assume that.
* Fix non-blocking connect() for Windows. Refactored the codeGuido van Rossum2002-06-131-12/+2
| | | | | | | | | | | that retries the connect() call in timeout mode so it can be shared between connect() and connect_ex(), and needs only a single #ifdef. The test for this was doing funky stuff I don't approve of, so I removed it in favor of a simpler test. This allowed me to implement a simpler, "purer" form of the timeout retry code. Hopefully that's enough (if you want to be fancy, use non-blocking mode and decode the errors yourself, like before).
* More style changes and little cleanups.Jeremy Hylton2002-06-131-63/+33
| | | | | | | | Remove __init__ that just called base class __init__ with same args. Fold long argument lists into fewer, shorter lines. Remove parens in tuple unpacks. Don't put multiple statements on one line with a semicolon. In find_library_file() compute the library_filename() upfront.
* Major overhaul of timeout sockets:Guido van Rossum2002-06-132-4/+7
| | | | | | | | | | | | | | | | | | | | - setblocking(0) and settimeout(0) are now equivalent, and ditto for setblocking(1) and settimeout(None). - Don't raise an exception from internal_select(); let the final call report the error (this means you will get an EAGAIN error instead of an ETIMEDOUT error -- I don't care). - Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets, so other theads can run (this was a bug in the original code). - Redid the retry logic in connect() and connect_ex() to avoid masking errors. This probably doesn't work for Windows yet; I'll fix that next. It may also fail on other platforms, depending on what retrying a connect does; I need help with this. - Get rid of the retry logic in accept(). I don't think it was needed at all. But I may be wrong.
* Fix a typo.Guido van Rossum2002-06-131-1/+2
| | | | Add a sleep (yuck!) to _testRecvFrom() so the server can set up first.
* Some more style improvementsJeremy Hylton2002-06-131-25/+4
|
* Python style conformance: Delete spaces between name of function and arglist.Jeremy Hylton2002-06-131-41/+41
| | | | Making the world better a little bit at a time <wink>.
* Whitespace nit.Guido van Rossum2002-06-131-1/+1
|
* Remove some overly complicated ways to concatenate and repeat stringsGuido van Rossum2002-06-121-6/+7
| | | | using "".join(). Fold a long line.
* Don't test for Java, test for sys.getrefcount.Guido van Rossum2002-06-121-2/+2
|
* Some provisional changes to get more tests to run on Windows (I hope).Guido van Rossum2002-06-121-6/+8
|
* Argh. Typo. :-(Guido van Rossum2002-06-121-1/+1
|
* Allow absent fromfd(), for Windows.Guido van Rossum2002-06-121-0/+2
|
* testSetSockOpt() should not require the reuse flag to be 1 -- anyGuido van Rossum2002-06-121-2/+2
| | | | | nonzero value is OK. Also fixed the error message for this and for testGetSockOpt().
* Lose the message on assertEqual calls -- they actually hideGuido van Rossum2002-06-121-18/+15
| | | | information on what went wrong.
* Docstring, layout and style tweaking. Increase fuzz to 1 second.Guido van Rossum2002-06-121-90/+87
|
* Add a new definition to Extension objects: depends.Jeremy Hylton2002-06-122-1/+6
| | | | | depends is a list of files that the target depends, but aren't direct sources of the target. think .h files.
* Add some more basic tests to validate the argument checking ofGuido van Rossum2002-06-121-1/+51
| | | | | settimeout(), test settimeout(None), and the interaction between settimeout() and setblocking().
* New test suite for the socket module by Michael Gilfix.Guido van Rossum2002-06-123-180/+486
| | | | Changed test_timeout.py to conform to the guidelines in Lib/test/README.
* Add a testcase to ensure that cycles going through the __class__ linkGuido van Rossum2002-06-121-0/+6
| | | | of a new-style instance are detected by the garbage collector.
* SF bug 567538: Generator can crash the interpreter (Finn Bock).Guido van Rossum2002-06-121-0/+20
| | | | | | | | | | This was a simple typo. Strange that the compiler didn't catch it! Instead of WHY_CONTINUE, two tests used CONTINUE_LOOP, which isn't a why_code at all, but an opcode; but even though 'why' is declared as an enum, comparing it to an int is apparently not even worth a warning -- not in gcc, and not in VC++. :-( Will fix in 2.2 too.
* Rework the code to have only the GvR RPC. Output from execution of userKurt B. Kaiser2002-06-1211-1190/+171
| | | | code is directed to the Shell.
* The opcode YIELD_STMT was accidentally called YIELD_VALUE here.Guido van Rossum2002-06-111-1/+1
|
* Fix SF #565414, FancyURLopener() needs to support **kwargsNeal Norwitz2002-06-111-2/+2
| | | | since the URLopener base class does and **kwargs are used in urlopen.
* Fix for problem reported by Neal Norwitz. Tighten up calculation ofMichael W. Hudson2002-06-111-0/+2
| | | | slicelength. Include his test case.
* This is my nearly two year old patchMichael W. Hudson2002-06-112-1/+73
| | | | | | | | | [ 400998 ] experimental support for extended slicing on lists somewhat spruced up and better tested than it was when I wrote it. Includes docs & tests. The whatsnew section needs expanding, and arrays should support extended slices -- later.
* Patch #488073: AtheOS port.Martin v. Löwis2002-06-1110-7/+1157
|
* add a version of GvR's q&d python idle printing patch,Steven M. Gava2002-06-115-3/+51
| | | | slightly tweaked and modified for the idlefork config system
* Took initial_tab and subsequent_tab away from the fill() method andGreg Ward2002-06-101-22/+34
| | | | | | | | transformed them into the initial_indent and subsequent_indent instance attributes. Now they actually work as advertised, ie. they are accounted for in the width of each output line. Plus you can use them with wrap() as well as fill(), and fill() went from simple-and-broken to trivial-and-working.
* SF patch 560794 (Greg Chapman): deepcopy can't handle customGuido van Rossum2002-06-101-8/+15
| | | | | | | | | | metaclasses. This is essentially the same problem as that reported in bug 494904 for pickle: deepcopy should treat instances of custom metaclasses the same way it treats instances of type 'type'. Bugfix candidate.
* Allow the standalone wrap() and fill() functions to take arbitraryGreg Ward2002-06-101-4/+6
| | | | keyword args, which are passed directly to the TextWrapper constructor.
* Make 'width' an instance attribute rather than an argument to the wrap()Greg Ward2002-06-101-31/+32
| | | | | | | and fill() methods. Keep interface of existing wrap() and fill() functions by going back to having them construct a new TextWrapper instance on each call, with the preferred width passed to the constructor.
* SF patch 564549 (Erik Andersén).Guido van Rossum2002-06-102-1/+12
| | | | | | | The WeakKeyDictionary constructor didn't work when a dict arg was given. Fixed by moving a line. Also adding a unit test. Bugfix candidate.