Commit Graph

130 Commits

Author SHA1 Message Date
Brett Cannon
fa84d923ec Remove two unneeded branches to an 'if' statement by applying De Morgan's Law
and creating a single 'if' statement along with a NULL default value for a
variable.

Also clean up a bunch of whitespace.

Found using Clang's static analyzer.
2010-05-05 20:30:30 +00:00
Brett Cannon
417439e6cd Partially revert the over-reaching r80813. 2010-05-05 20:24:30 +00:00
Brett Cannon
0b03f10afb Remove three unneeded variable assignments.
Found using Clang's static analyzer.
2010-05-05 20:20:19 +00:00
Alexandre Vassalotti
b646547bb4 Issue #2333: Backport set and dict comprehensions syntax. 2010-01-11 22:36:12 +00:00
Alexandre Vassalotti
ee936a2130 Issue #2335: Backport set literals syntax from Python 3.x. 2010-01-09 23:35:54 +00:00
Benjamin Peterson
99a5023c80 improve several corner cases related with argument names in parenthesis
- Fix #7362: give a good error message for parenthesized arguments with
  defaults.

- Add a py3k warning for any parenthesized arguments since those are not allowed
  in Py3.  This warning is not given in tuple unpacking, since that incurs the
  tuple unpacking warning.
2009-11-19 22:54:57 +00:00
Benjamin Peterson
ea0e3b0d60 do a backport of r75928
The added test does not fail without the patch, but we still fix the issue of
surrogates being used in wide builds where they should not be.
2009-10-29 01:49:07 +00:00
Eric Smith
abc9f70381 Removed PyOS_ascii_atof from ast.c, as mentioned in issue 7117. 2009-10-27 18:33:14 +00:00
Benjamin Peterson
7adbb5a35d #7050 fix a SystemError when using tuple unpacking and augmented assignment 2009-10-03 20:23:24 +00:00
Benjamin Peterson
c0ba828857 better col_offsets for "for" statements with tuple unpacking #6704
Patch from Frank Wierzbicki.
2009-08-15 22:59:21 +00:00
Benjamin Peterson
4879c907ce the Slice in x[::] has to have step as None to help the interpreter 2009-07-20 20:28:08 +00:00
Benjamin Peterson
a72be3b325 when no module is given in a 'from' relative import, make ImportFrom.module NULL 2009-06-13 20:23:33 +00:00
Benjamin Peterson
52c4bec76b give a better error message when deleting () 2009-06-13 17:08:53 +00:00
Benjamin Peterson
5d1ff94b9e set Print.values to NULL if there are no values 2009-06-13 16:19:19 +00:00
Benjamin Peterson
d1f5a59edb allow importing from a module named None if it has an 'as' clause 2009-06-13 13:06:21 +00:00
Benjamin Peterson
565e1b6bb7 prevent import statements from assigning to None 2009-06-13 03:46:30 +00:00
Benjamin Peterson
4afbba3d34 keep the slice.step field as NULL if no step expression is given 2009-06-13 01:40:00 +00:00
Benjamin Peterson
4efb5d0b82 remove check for case handled in sub-function 2009-06-11 22:29:23 +00:00
Benjamin Peterson
b266481ed8 revert r73361 2009-06-11 17:49:38 +00:00
Benjamin Peterson
e5fa5fe8fc remove duplicate check 2009-06-11 16:25:52 +00:00
Benjamin Peterson
a5a5728cf0 remove error checks already done in set_context() 2009-06-08 23:44:13 +00:00
Benjamin Peterson
8ea4ded9a6 remove useless assertion 2009-06-08 22:18:32 +00:00
Georg Brandl
944f684ce6 Allow multiple context managers in one with statement, as proposed
in http://codereview.appspot.com/53094 and accepted by Guido.

The construct is transformed into multiple With AST nodes so that
there should be no problems with the semantics.
2009-05-25 21:02:56 +00:00
Amaury Forgeot d'Arc
59ce042766 #4077: No need to append \n when calling Py_FatalError
+ fix a declaration to make it match the one in pythonrun.h
2009-01-17 20:18:59 +00:00
Mark Dickinson
422ce06b9c Issue #4461: Safety check in parsenumber (ast.c) 2008-12-05 17:59:46 +00:00