- 18 Sep, 2001 6 commits
-
-
Guido van Rossum authored
to raise TypeError. In practice, a disallowed attribute assignment can raise either TypeError or AttributeError (and it's unclear which is better). So allow either. (Yes, this is in anticipation of a code change that switches the exception raised. :-) - Add a utility function, cantset(), which verifies that setting a particular attribute to a given value is disallowed, and also that deleting that same attribute is disallowed. Use this in the test_func_*() tests. - Add a new set of tests that test conformance of various instance method attributes. (Also in anticipation of code that changes their implementation.)
-
Guido van Rossum authored
structmember.h, which was missing (and caused me a snide comment by Tim when he fixed something I missed because of the missed dependency :-).
-
Tim Peters authored
-
Tim Peters authored
Add it back to the list of tests we expect to skip on Windows.
-
Tim Peters authored
-
Tim Peters authored
definition. Guido, what else did you forget to check in <wink>?
-
- 17 Sep, 2001 18 commits
-
-
Tim Peters authored
Also raise TestSkipped (intead of appearing to fail) if the import lock is held.
-
Guido van Rossum authored
This uses the new "restricted" feature of structmember, and getset descriptors for some of the type checks.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
compile() becomes replacement for builtin compile() compileFile() generates a .pyc from a .py both are exported in __init__ compiler.parse() gets optional second argument to specify compilation mode, e.g. single, eval, exec Add AbstractCompileMode as parent class and Module, Expression, and Interactive as concrete subclasses. Each corresponds to a compilation mode. THe AbstractCompileMode instances in turn delegate to CodeGeneration subclasses specialized for their particular functions -- ModuleCodeGenerator, ExpressionCodeGeneration, InteractiveCodeGenerator.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
The argument properties are ordered from easiest to hardest. The harder the arg, the more complicated that code that must be generated to return it from getChildren() and/or getChildNodes(). The old calculation routine was bogus, because it always set hardest_arg to the hardness of the last argument. Now use max() to always set it to the hardness of the hardest argument.
-
Jeremy Hylton authored
Remove the only test in the syntax module. It ends up that the transformer must handle this error case. In the transformer, check for a list compression in com_assign_list() by looking for a list_for node where a comma is expected. In pycodegen.compile() re-raise the SyntaxError rather than catching it and exiting
-
Guido van Rossum authored
Renamed the 'readonly' field to 'flags' and defined some new flag bits: READ_RESTRICTED and WRITE_RESTRICTED, as well as a shortcut RESTRICTED that means both.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
If passed a .py file as an argument, try to find its accompanying .pyc.
-
Jeremy Hylton authored
Invoke compiler.syntax.check() after building AST. If a SyntaxError occurs, print the error and exit without generating a .pyc file. Refactor code to use compiler.misc.set_filename() rather than passing filename argument around to each CodeGenerator instance.
-
Jeremy Hylton authored
-
Fredrik Lundh authored
-
Jeremy Hylton authored
-
Andrew M. Kuchling authored
module on the Cygwin platform.
-
Guido van Rossum authored
Once upon a time, I put together a little function that tries to find the canonical filename for a given pathname on POSIX. I've finally gotten around to turning it into a proper patch with documentation. On non-POSIX, I made it an alias for 'abspath', as that's the behavior on POSIX when no symlinks are encountered in the path. Example: >>> os.path.realpath('/usr/bin/X11/X') '/usr/X11R6/bin/X'
-
Guido van Rossum authored
supplied values are the most "normal" or "common" values found for recent 32 bit machines. This now seems to work to build Python 2.2 for the ARM processor used on the iPAQ.
-
Tim Peters authored
and are lists, and then just the string elements (if any)). There are good and bad reasons for this. The good reason is to support dir() "like before" on objects of extension types that haven't migrated to the class introspection API yet. The bad reason is that Python's own method objects are such a type, and this is the quickest way to get their im_self etc attrs to "show up" via dir(). It looks much messier to move them to the new scheme, as their current getattr implementation presents a view of their attrs that's a untion of their own attrs plus their im_func's attrs. In particular, methodobject.__dict__ actually returns methodobject.im_func.__dict__, and if that's important to preserve it doesn't seem to fit the class introspection model at all.
-
- 16 Sep, 2001 3 commits
-
-
Tim Peters authored
-
Tim Peters authored
type(x) is T tests with isinstance(x, T) Also got rid of a future-generators import, left over from code that wasn't intended to get checked in.
-
Tim Peters authored
introspection incompatibility, but in fact it's just that calltips always gave up on a docstring that started with a newline (but didn't realize they were giving up <wink>).
-
- 15 Sep, 2001 5 commits
-
-
Tim Peters authored
-
Tim Peters authored
Rewrote the 'p' description.
-
Tim Peters authored
little test to make sure it doesn't come back.
-
Guido van Rossum authored
Both int and long multiplication are changed to be more careful in their assumptions about when one of the arguments is a sequence: the assumption that at least one of the arguments must be an int (or long, respectively) is still held, but the assumption that these don't smell like sequences is no longer true: a subtype of int or long may well have a sequence-repeat thingie!
-
Tim Peters authored
and count exceed 255. Changed to preserve as much of the string as possible (instead of count%256 characters).
-
- 14 Sep, 2001 8 commits
-
-
Jeremy Hylton authored
-
Jeremy Hylton authored
the compiler package generates a module-unique trailing suffix for each lambda
-
Jeremy Hylton authored
-
Jeremy Hylton authored
Remove the option to have nested scopes or old LGB scopes. This has a large impact on the code base, by removing the need for two variants of each CodeGenerator. Add a get_module() method to CodeGenerator objects, used to get the future features for the current module. Set CO_GENERATOR, CO_GENERATOR_ALLOWED, and CO_FUTURE_DIVISION flags as appropriate. Attempt to fix the value of nlocals in newCodeObject(), assuming that nlocals is 0 if CO_NEWLOCALS is not defined.
-
Jeremy Hylton authored
bound. When a Yield() node is visited, assign to the generator attribute of the scope, not the visitor.
-
Jeremy Hylton authored
-
Jeremy Hylton authored
-
Tim Peters authored
ideas about sizeof(long).
-