Commit Graph

82 Commits

Author SHA1 Message Date
Brett Cannon e974689038 Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.

Closes issue #1631171.
2008-04-12 23:44:07 +00:00
Amaury Forgeot d'Arc 7adc776ea6 Issue 2408: remove the _types module
It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
when they can easily be obtained with python code.
These expressions even work with Jython.

I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
at least this change makes it simpler.
2008-04-08 22:07:05 +00:00
Guido van Rossum 6f4ee2d48f Fix misleading comment reported in issue #1917. 2008-01-23 22:43:27 +00:00
Barry Warsaw 00decd7835 Patch #1520294: Support for getset and member descriptors in types.py,
inspect.py, and pydoc.py.  Specifically, this allows for querying the type of
an object against these built-in C types and more importantly, for getting
their docstrings printed in the interactive interpreter's help() function.

This patch includes a new built-in module called _types which provides
definitions of getset and member descriptors for use by the types.py module.
These types are exposed as types.GetSetDescriptorType and
types.MemberDescriptorType.  Query functions are provided as
inspect.isgetsetdescriptor() and inspect.ismemberdescriptor().  The
implementations of these are robust enough to work with Python implementations
other than CPython, which may not have these fundamental types.

The patch also includes documentation and test suite updates.

I commit these changes now under these guiding principles:

1. Silence is assent.  The release manager has not said "no", and of the few
   people that cared enough to respond to the thread, the worst vote was "0".

2. It's easier to ask for forgiveness than permission.

3. It's so dang easy to revert stuff in svn, that you could view this as a
   forcing function. :)

Windows build patches will follow.
2006-07-27 23:43:15 +00:00
Anthony Baxter 1ad9ec276e whoops. missed one in an auto-generated file. another extern "C" {} for C++ compiler compatibility 2006-04-13 04:49:25 +00:00
Martin v. Löwis 577b5b960d Create _ast module.
Cleanup Python-ast.c generation.
2006-02-27 15:23:19 +00:00
Tim Peters 943382c8e5 Removed WITH_CYCLE_GC #ifdef-ery. Holes:
+ I'm not sure what to do about configure.in.  Left it alone.

+ Ditto pyexpat.c.  Fred or Martin will know what to do.
2002-07-07 03:59:34 +00:00
Neil Schemenauer 7d0e19e1f4 gcmodule is now enabled here 2001-08-30 00:12:32 +00:00
Tim Peters 6d6c1a35e0 Merge of descr-branch back into trunk. 2001-08-02 04:15:00 +00:00
Barry Warsaw 9ac33509de _PyImport_Inittab: define the exceptions module's init function.
Fixes bug #121706.
2001-01-23 21:46:57 +00:00
Andrew M. Kuchling 469d5bb0b4 Clarify two comments 2000-11-30 01:57:18 +00:00
Thomas Wouters 53e7fd77a7 Fix prototypes generated by makesetup, so they include '(void)' rather than
empty argumentlists.
2000-07-23 00:02:15 +00:00
Guido van Rossum 3f2fa0a53d Add "exceptions" to list of built-in modules for the sake of
sys.builtin_module_names.  (Noticed by Toby Dickenson.)
2000-07-12 12:09:05 +00:00
Guido van Rossum ffcc3813d8 Change copyright notice - 2nd try. 2000-06-30 23:58:06 +00:00
Guido van Rossum fd71b9e9d4 Change copyright notice. 2000-06-30 23:50:40 +00:00
Guido van Rossum 87490eb3b0 Renamed inittab. 1997-04-29 20:31:59 +00:00
Guido van Rossum d266eb460e New permission notice, includes CNRI. 1996-10-25 14:44:06 +00:00
Guido van Rossum 2c26cfe776 Use struct _inittab def from import.h 1996-05-23 22:57:18 +00:00
Guido van Rossum 37ba0bc50b split config.c in 1000 parts; new main; new unfinished objective-C module 1995-08-04 04:20:45 +00:00
Guido van Rossum ef4ee62a0f added getpalatform() 1995-07-07 22:38:14 +00:00
Guido van Rossum 74ee2878b6 move decl of realmain() out of #ifdef 1995-03-30 11:00:56 +00:00
Guido van Rossum e333d167fe 1995 copyright 1995-03-14 15:04:19 +00:00
Guido van Rossum 9e575ff7d8 remove bogus ## in front of gcc __VERSION__ 1995-02-17 15:11:57 +00:00
Guido van Rossum 57c33af90e tack compiler name/version to version string if known 1995-02-13 17:10:11 +00:00
Guido van Rossum 6c1874fc2b changes for C++ (Tim MacKenzie) 1995-01-10 17:43:33 +00:00
Guido van Rossum 524b588553 Added 1995 to copyright message.
Setup.in: clarified Tk comments somewhat.
structmodule.c: use memcpy() instead of double precision assignment.
1995-01-04 19:10:35 +00:00
Guido van Rossum 3bbc62e9c2 Another bulky set of minor changes.
Note addition of gethostbyaddr() and improved repr() for sockets,
renaming of md5.md5() to md5.new(), and fixing of leaks in threads.
1995-01-02 19:30:30 +00:00
Guido van Rossum e8a1e8cef3 Fix getpythonpath() fix; never #include frozen.c. 1994-10-05 14:48:22 +00:00
Guido van Rossum 6e890b86a8 Save static pointer to malloc'ed buffer 1994-10-05 12:25:12 +00:00
Guido van Rossum 7b1e974b4b Makefile.pre.in: add $(OPT) to link command
audioop.c: fix for MPW
config.c.in: save original argc/argv for Lance
rotormodule.c: new coding conventions
timemodule.c: add casts for Lance
1994-08-29 10:46:42 +00:00
Guido van Rossum 9731d4470f * Modules/config.c.in: change mac specific things 1994-08-23 13:48:30 +00:00
Guido van Rossum 72824bab44 Move all code from version.c into config.c 1994-08-19 12:03:04 +00:00
Guido van Rossum b6775db241 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
Sjoerd Mullender c4f169cc5a rgbimgmodule.c, Makefile, config.c: new module to read RGB image files.
Does not need any SGI-specific libraries.
cgen.py, cstubs, Makefile: Generate glmodule.c differently so that it
	can be compiled using an ANSI compiler.
1993-12-21 17:06:12 +00:00
Guido van Rossum 52f2c05401 * parsermodule.c, Makefile, config.c: rudimentary interface to the Python
parser.
* mappingobject.c (lookmapping): 'freeslot' was never used due to a bug in
  the code.
1993-11-10 12:53:24 +00:00
Guido van Rossum e77a757094 * nismodule.c: database keys and values can contain null bytes. be more
careful about these.
* arraymodule.c: added 8 byte swap; added 'i' format character; added
  reverse() method; rename read/write to fromfile/tofile.
* config.c: Set version to 0.9.9++.
* rotormodule.c (r_rand): declare k1..k5 as unsigned longs so the shifts
  will have a well-defined effect independent of word size.
* bltinmodule.c: renamed bagof() to filter().
1993-11-03 15:01:26 +00:00
Guido van Rossum cacd9579d4 * stdwinmodule.c (stdwin_done): interface to shutdown stdwin (now this is
no longer done by config.c).
* stdwinmodule.c (initstdwin), config.c (initall): get command line
  arguments from sys.argv instead of special-casing stdwin in config.c
* import.c (get_module): fix core dump when foomodule.o does not define
  initfoo().
* ChangeLog: documented changes by Sjoerd.
1993-10-18 11:44:47 +00:00
Sjoerd Mullender a9c3c22c33 * Extended X interface: pixmap objects, colormap objects visual objects,
image objects, and lots of new methods.
* Added counting of allocations and deallocations of builtin types if
  COUNT_ALLOCS is defined.  Had to move calls to NEWREF down in some
  files.
* Bug fix in sorting lists.
1993-10-11 12:54:31 +00:00
Guido van Rossum e906606f5d Final touch before release. 1993-07-29 13:14:32 +00:00
Guido van Rossum a3309960a5 * Added support for X11 modules.
* Makefile: change location of FORMS library.
* posixmodule.c: turn #if 0 into #ifdef MSDOS (stuff in unistd.h or not)
* Almost all .h files: added CPP magic to avoid duplicate inclusions and
  to support inclusion from C++.
1993-07-28 09:05:47 +00:00
Guido van Rossum e22e6442b7 * config.c: different default PYTHONPATH for MS-DOS
* timemodule.c: change #ifdef TURBO_C into #ifdef MSDOS
* posixmodule.c: MSDOS changes by Marcel van der Peijl (Digicash)
* stropmodule.c: use C isspace(c) to test for whitespace; add
  whitespace, lowercase and uppercase variables to the module.
1993-07-09 10:51:31 +00:00
Guido van Rossum f56e3db1dd Support for frozen scripts; added -i option. 1993-04-01 20:59:32 +00:00
Guido van Rossum 9bfef44d97 * Changed all copyright messages to include 1993.
* Stubs for faster implementation of local variables (not yet finished)
* Added function name to code object.  Print it for code and function
  objects.  THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version
  number has changed accordingly)
* Print address of self for built-in methods
* New internal functions getattro and setattro (getattr/setattr with
  string object arg)
* Replaced "dictobject" with more powerful "mappingobject"
* New per-type functio tp_hash to implement arbitrary object hashing,
  and hashobject() to interface to it
* Added built-in functions hash(v) and hasattr(v, 'name')
* classobject: made some functions static that accidentally weren't;
  added __hash__ special instance method to implement hash()
* Added proper comparison for built-in methods and functions
1993-03-29 10:43:31 +00:00
Guido van Rossum 778983b481 Added new module "array" (for now optional) defining array objects. 1993-02-19 15:55:02 +00:00
Guido van Rossum 34679b7661 * Added Fixcprt.py: script to fix copyright message.
* various modules: added 1993 to copyright.
* thread.c: added copyright notice.
* ceval.c: minor change to error message for "+"
* stdwinmodule.c: check for error from wfetchcolor
* config.c: MS-DOS fixes (define PYTHONPATH, use DELIM, use osdefs.h)
* Add declaration of inittab to import.h
* sysmodule.c: added sys.builtin_module_names
* xxmodule.c, xxobject.c: fix minor errors
1993-01-26 13:33:44 +00:00
Guido van Rossum 0b0db8e3a0 Added separate main program for the Mac: macmain.c
stdwinmodule.c: wsetfont can now return an error
Makefile: add CL_USE and CL_LIB*S; config.c: move CL part around
New things in imgfile; also in Makefile.
longobject.c: fix comparison of negative long ints...  [REAL BUG!]
marshal.c: add dumps() and loads() to read/write strings
timemodule.c: make sure there's always a floatsleep()
posixmodule.c: rationalize struct returned by times()
Makefile: add test target, disable imgfile by default
thread.c: Improved coexistance with dl module (sjoerd)
stdwinmodule.c: Change include stdwin.h if macintosh
rotormodule.c: added missing last argument to RTR_?_region calls
confic.c: merged with configmac.c, added 1993 to copyright message
fileobject.c: int compared to NULL in writestring(); change fopenRF ifdef
timemodule.c: simplify times() using mkvalue; include myselect.h
  earlier (for sequent).
posixmodule: for sequent, include unistd.h instead of explicit
  extern definitions and don't define rename()
Makefile: change misleading/wrong MD5 comments
1993-01-21 16:07:51 +00:00
Guido van Rossum e35399ea7b Checking in last-minute changes that are already part of release 0.9.8 1993-01-10 18:33:56 +00:00
Guido van Rossum a2b7f40513 * Configure.py: use #!/usr/local/bin/python
* posixmodule.c: move extern function declarations to top
* listobject.c: cmp() arguments must be void* if __STDC__
* Makefile, allobjects.h, panelmodule.c, modsupport.c: get rid of
  strdup() -- it is a portability risk
* Makefile: enclosed ranlib command in parentheses for Sequent Make
  which aborts if the command is not found even if '-' is present
* timemodule.c: time() returns a floating point number, in microsecond
  precision if BSD_TIME is defined.
1993-01-04 09:09:59 +00:00
Guido van Rossum 8ed294150e Added new modules mpz, md5 (by JH, requiring GNU MP). 1992-12-08 16:10:18 +00:00
Guido van Rossum c89705d697 * config.c: Added audioop to lists.
* Makefile: change default source directory
* socketmodule.c: added getsockname and getpeername
* bltinmodule.c: corrected typo in type() error message
* Added new built-in functions str() and repr(): repr(x) == `x`;
  str(x) == x if x is a string, otherwise str(x) == repr(x).
* Added joinfields to stropmodule.c (string.join calls joinfields now)
1992-11-26 08:54:07 +00:00