summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_funcattrs.py
Commit message (Collapse)AuthorAgeFilesLines
* cleanup the construction of __qualname__ (closes #19301 again)Benjamin Peterson2013-10-201-1/+4
|
* give explicitly global functions and classes a global __qualname__ (closes ↵Benjamin Peterson2013-10-191-0/+4
| | | | #19301)
* Issue #13577: Built-in methods and functions now have a __qualname__.Antoine Pitrou2011-12-231-1/+27
| | | | Patch by sbt.
* PEP 3155 / issue #13448: Qualified name for classes and functions.Antoine Pitrou2011-11-251-0/+27
|
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-2/+2
| | | | A patch from Dave Malcolm.
* Recorded merge of revisions 74650 via svnmerge fromGeorg Brandl2009-09-041-38/+87
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r74650 | georg.brandl | 2009-09-04 13:19:34 +0200 (Fr, 04 Sep 2009) | 1 line #5101: add back tests to test_funcattrs that were lost during unittest conversion, and make some PEP8 cleanups. ........
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-9/+9
|
* Issue 5982: Classmethod and staticmethod expose wrapped function with __func__.Raymond Hettinger2009-05-291-1/+13
|
* Merged revisions 69846 via svnmerge fromMark Dickinson2009-02-211-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r69846 | mark.dickinson | 2009-02-21 20:27:01 +0000 (Sat, 21 Feb 2009) | 2 lines Issue #5341: Fix a variety of spelling errors. ........
* Issue #1717, stage 2: remove uses of tp_compare in Modules and mostMark Dickinson2009-02-011-1/+32
| | | | Objects.
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-2/+2
|
* Migrate remaining tests from UserDict.UserDict to collections.UserDict.Raymond Hettinger2008-02-061-1/+1
|
* Merge r60522 from trunk.Georg Brandl2008-02-051-368/+232
|
* Merged revisions 59193-59201 via svnmerge fromChristian Heimes2007-11-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r59195 | facundo.batista | 2007-11-27 19:50:12 +0100 (Tue, 27 Nov 2007) | 4 lines Moved the errno import from inside the functions to the module level. Fixes issue 1755179. ........ r59199 | christian.heimes | 2007-11-27 22:28:40 +0100 (Tue, 27 Nov 2007) | 1 line Backport of changes to PCbuild9 from the py3k branch ........ r59200 | christian.heimes | 2007-11-27 22:34:01 +0100 (Tue, 27 Nov 2007) | 1 line Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module. ........ r59201 | christian.heimes | 2007-11-27 22:35:44 +0100 (Tue, 27 Nov 2007) | 1 line Added a deprecation warning to the 'new' module. ........
* Removed the API to create unbound methods and simplified the API for bound ↵Christian Heimes2007-11-271-20/+21
| | | | | | | methods. The signature is PyMethod_New(func, instance). Also removed im_class and renamed im_self to __self__ and im_func to __func__. im_class can be substituted with method.__self__.__class__. I've also updated some parts of the documenation.
* Merged revisions 59107-59186 via svnmerge fromGuido van Rossum2007-11-261-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk (Note: some conflicts in the PCbuild9 directory reverted. Sorry Christian!) ........ r59120 | christian.heimes | 2007-11-22 03:21:16 -0800 (Thu, 22 Nov 2007) | 3 lines Backport of the PCbuild9 directory from the py3k branch. I've finished the last task for the PCbuild9 directory today. I don't think there is much left to do. Now you can all play around with the shiny new VS 2008 and try the PGO builds. I was able to get a speed improvement of about 10% on py3k. Have fun! :) ........ r59126 | brett.cannon | 2007-11-22 16:06:51 -0800 (Thu, 22 Nov 2007) | 2 lines Fix a bug in the test for using __loader__.get_data(). ........ r59131 | christian.heimes | 2007-11-22 23:05:03 -0800 (Thu, 22 Nov 2007) | 1 line Backport of PCbuild9 fixes from py3k r59130 ........ r59132 | christian.heimes | 2007-11-23 01:10:36 -0800 (Fri, 23 Nov 2007) | 2 lines Applied patch #1754273 and #1754271 from Thomas Glee The patches are adding deprecation warnings for back ticks and <> ........ r59133 | christian.heimes | 2007-11-23 04:12:02 -0800 (Fri, 23 Nov 2007) | 2 lines Fixed problems in the last commit. Filenames and line numbers weren't reported correctly. Backquotes still don't report the correct file. The AST nodes only contain the line number but not the file name. ........ r59134 | christian.heimes | 2007-11-23 04:16:35 -0800 (Fri, 23 Nov 2007) | 1 line How did the comment get there? ........ r59135 | christian.heimes | 2007-11-23 05:25:31 -0800 (Fri, 23 Nov 2007) | 1 line And yet another fix for the patch. Paul Moore has send me a note that I've missed a declaration. The additional code has moved the declaration in the middle of the block. ........ r59136 | andrew.kuchling | 2007-11-23 05:37:39 -0800 (Fri, 23 Nov 2007) | 1 line Add item ........ r59137 | skip.montanaro | 2007-11-23 09:08:35 -0800 (Fri, 23 Nov 2007) | 2 lines Make trace and doctest play nice together (issue 1429818). Will backport. ........ r59139 | skip.montanaro | 2007-11-23 09:12:47 -0800 (Fri, 23 Nov 2007) | 1 line issue 1429818 ........ r59144 | facundo.batista | 2007-11-23 09:59:00 -0800 (Fri, 23 Nov 2007) | 10 lines Major change in the internal structure of the Decimal number: now it does not store the mantissa as a tuple of numbers, but as a string. This avoids a lot of conversions, and achieves a speedup of 40%. The API remains intact. Thanks Mark Dickinson. ........ r59146 | facundo.batista | 2007-11-23 10:14:50 -0800 (Fri, 23 Nov 2007) | 3 lines Test cases from Cowlishaw, v2.57. All are pased cleanly. ........ r59156 | christian.heimes | 2007-11-23 17:36:02 -0800 (Fri, 23 Nov 2007) | 2 lines Added filename to compiling struct based on Martin's suggestion. I'm wonder why I was trying to add the filename to the node all the time. The compiling struct is more obvious. ........ r59158 | christian.heimes | 2007-11-23 17:53:59 -0800 (Fri, 23 Nov 2007) | 2 lines Backport of fixes from py3k branch svn merge -r59131:HEAD ../../py3k/PCbuild9/ . ........ r59159 | skip.montanaro | 2007-11-23 20:29:08 -0800 (Fri, 23 Nov 2007) | 1 line revert change that breaks test_doctest (which I forgot to run - sorry) ........ r59162 | skip.montanaro | 2007-11-23 20:31:15 -0800 (Fri, 23 Nov 2007) | 1 line revert ........ r59164 | georg.brandl | 2007-11-24 03:31:46 -0800 (Sat, 24 Nov 2007) | 3 lines #1344: document that you need to open std{in,out,err} with PIPE if you want communicate() to work as described. ........ r59165 | georg.brandl | 2007-11-24 03:39:13 -0800 (Sat, 24 Nov 2007) | 2 lines #1467: fix documentation for TestResult.add{Error,Failure}. ........ r59166 | georg.brandl | 2007-11-24 03:42:14 -0800 (Sat, 24 Nov 2007) | 2 lines #1355: remove mention of PyXML from xml.dom docs. ........ r59169 | amaury.forgeotdarc | 2007-11-24 05:20:22 -0800 (Sat, 24 Nov 2007) | 2 lines Warning "<> not supported in 3.x" should be enabled only when the -3 option is set. ........ r59170 | amaury.forgeotdarc | 2007-11-24 05:44:17 -0800 (Sat, 24 Nov 2007) | 3 lines Issue #1445: Fix a SystemError when accessing the ``cell_contents`` attribute of an empty cell object. Now a ValueError is raised. ........ r59172 | georg.brandl | 2007-11-24 05:56:09 -0800 (Sat, 24 Nov 2007) | 3 lines #1735632: add O_NOATIME constant to os module. Also document a few other O_ constants that were missing from documentation. ........ r59173 | skip.montanaro | 2007-11-24 06:30:47 -0800 (Sat, 24 Nov 2007) | 1 line back in these go - thanks to Titus Brown for the fix ........ r59176 | martin.v.loewis | 2007-11-24 10:33:40 -0800 (Sat, 24 Nov 2007) | 2 lines Bug #1494: Document that appendChild removes first. ........ r59186 | guido.van.rossum | 2007-11-26 14:16:49 -0800 (Mon, 26 Nov 2007) | 2 lines A thread-less variant of brownian.py, submitted by Michele Simoniato. ........
* Patch from Georg Brandl and me for #1493Christian Heimes2007-11-251-44/+17
| | | | Remove unbound method objects
* Raise statement normalization in Lib/test/.Collin Winter2007-08-291-24/+24
|
* Use unicode and stop supporting str8Neal Norwitz2007-08-261-2/+2
|
* Fix test_funcattrs.py: __name__ attribute must be str8.Walter Dörwald2007-05-241-2/+2
|
* Change all the function attributes from func_* -> __*__. This gets ridNeal Norwitz2007-02-251-44/+25
| | | | | of func_name, func_dict and func_doc as they already exist as __name__, __dict__ and __doc__.
* Fix most trivially-findable print statements.Guido van Rossum2007-02-091-6/+6
| | | | | | | | | There's one major and one minor category still unfixed: doctests are the major category (and I hope to be able to augment the refactoring tool to refactor bona fide doctests soon); other code generating print statements in strings is the minor category. (Oh, and I don't know if the compiler package works.)
* Patch #1550800: make exec a function.Georg Brandl2006-09-061-1/+1
|
* Killed the <> operator. You must now use !=.Guido van Rossum2006-08-241-10/+10
| | | | | Opportunistically also fixed one or two places where '<> None' should be 'is not None' and where 'type(x) <> y' should be 'not isinstance(x, y)'.
* FixMichael W. Hudson2005-02-171-0/+3
| | | | | | | | [ 1124295 ] Function's __name__ no longer accessible in restricted mode which I introduced with a bit of mindless copy-paste when making __name__ writable. You can't assign to __name__ in restricted mode, which I'm going to pretend was intentional :)
* Wrote down the invariants of some common objects whose structure isArmin Rigo2004-10-281-2/+11
| | | | | | | | | | exposed in header files. Fixed a few comments in these headers. As we might have expected, writing down invariants systematically exposed a (minor) bug. In this case, function objects have a writeable func_code attribute, which could be set to code objects with the wrong number of free variables. Calling the resulting function segfaulted the interpreter. Added a corresponding test.
* Whitespace normalization.Tim Peters2004-08-131-1/+1
|
* This is my patchMichael W. Hudson2004-08-121-2/+9
| | | | | | | [ 1004703 ] Make func_name writable plus fixing a couple of nits in the documentation changes spotted by MvL and a Misc/NEWS entry.
* Provide __module__ attributes for functions defined in C and Python.Jeremy Hylton2003-01-311-0/+4
| | | | | | | | | | | | | | __module__ is the string name of the module the function was defined in, just like __module__ of classes. In some cases, particularly for C functions, the __module__ may be None. Change PyCFunction_New() from a function to a macro, but keep an unused copy of the function around so that we don't change the binary API. Change pickle's save_global() to use whichmodule() if __module__ is None, but add the __module__ logic to whichmodule() since it might be used outside of pickle.
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Fix for SF bug #472940: can't getattr() attribute shown by dir()Guido van Rossum2001-10-221-5/+5
| | | | | | | | | | There really isn't a good reason for instance method objects to have their own __dict__, __doc__ and __name__ properties that just delegate the request to the function (callable); the default attribute behavior already does this. The test suite had to be fixed because the error changes from TypeError to AttributeError.
* Undo some (but not all) of the more lenient acceptance ofGuido van Rossum2001-09-181-9/+9
| | | | (AttributeError, TypeError) -- the leniency wasn't needed everywhere.
* - Some tests that check that assignments are not allowed expect thisGuido van Rossum2001-09-181-85/+95
| | | | | | | | | | | | | | | | 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.)
* Rewrite function attributes to use the generic routines properly.Guido van Rossum2001-09-171-1/+158
| | | | | This uses the new "restricted" feature of structmember, and getset descriptors for some of the type checks.
* Test the new semantics for setting and deleting a function's __dict__Barry Warsaw2001-08-141-45/+50
| | | | | | | | | attribute. Deleting it, or setting it to a non-dictionary result in a TypeError. Note that getting it the first time magically initializes it to an empty dict so that func.__dict__ will always appear to be a dictionary (never None). Closes SF bug #446645.
* Additional tests for current, PEP described semantics:Barry Warsaw2001-02-261-3/+36
| | | | | | | | | | | | - func.__dict__ is None until the first attribute is assigned - del func.__dict__ is equivalent to func.__dict__ = None - disallowing assignment to function attribute through unbound method (it was always illegal to assign through bound method). - verifying that setting attribute explicitly on underlying function via meth.im_func is okay.
* Whitespace normalization.Tim Peters2001-02-091-4/+3
|
* The one thing I love more then writing code is deleting code.Moshe Zadka2001-01-291-0/+19
| | | | | | | | | * Removed func_hash and func_compare, so they can be treated as immutable content-less objects (address hash and comparison) * Added tests to that affect to test_funcattrs (also testing func_code is writable) * Reverse meaning of tests in test_opcodes which checked identical code gets identical functions
* Add some regression tests of coredump bugs in funcobject.c 2.31. AlsoBarry Warsaw2001-01-191-0/+16
| | | | | added a test of a coredump that would occur when del'ing func_defaults (put here for convenience).
* Add a test case suggested by Guido, where a method is created with theBarry Warsaw2001-01-151-0/+38
| | | | new module.
* Committing PEP 232, function attribute feature, approved by Guido.Barry Warsaw2001-01-151-0/+102
Closes SF patch #103123. Regression test for function attributes, with output file.