<feed xmlns='http://www.w3.org/2005/Atom'>
<title>python.git/Lib/test/test_funcattrs.py, branch 2.3</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/test_funcattrs.py?h=2.3</id>
<link rel='self' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/atom/Lib/test/test_funcattrs.py?h=2.3'/>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/'/>
<updated>2003-01-31T18:33:18Z</updated>
<entry>
<title>Provide __module__ attributes for functions defined in C and Python.</title>
<updated>2003-01-31T18:33:18Z</updated>
<author>
<name>Jeremy Hylton</name>
<email>jeremy@alum.mit.edu</email>
</author>
<published>2003-01-31T18:33:18Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=4f0dcc9a9a4629607d4fff79912e8d0c86cd3914'/>
<id>urn:sha1:4f0dcc9a9a4629607d4fff79912e8d0c86cd3914</id>
<content type='text'>
__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.
</content>
</entry>
<entry>
<title>Complete the absolute import patch for the test suite.  All relative</title>
<updated>2002-07-30T23:27:12Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2002-07-30T23:27:12Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=408b6d34de2b1a6ba690557def435adce9314184'/>
<id>urn:sha1:408b6d34de2b1a6ba690557def435adce9314184</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Fix for SF bug #472940: can't getattr() attribute shown by dir()</title>
<updated>2001-10-22T02:00:09Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-10-22T02:00:09Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=56ff387a7e625a692851e2e5ffdea096b72831f7'/>
<id>urn:sha1:56ff387a7e625a692851e2e5ffdea096b72831f7</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Undo some (but not all) of the more lenient acceptance of</title>
<updated>2001-09-18T03:55:22Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-18T03:55:22Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=db2a902dee92a7569ad08ddff899955925a903e0'/>
<id>urn:sha1:db2a902dee92a7569ad08ddff899955925a903e0</id>
<content type='text'>
(AttributeError, TypeError) -- the leniency wasn't needed everywhere.
</content>
</entry>
<entry>
<title>- Some tests that check that assignments are not allowed expect this</title>
<updated>2001-09-18T03:28:54Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-18T03:28:54Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=bd131497112da319c4361c3e8656b5b7055011e3'/>
<id>urn:sha1:bd131497112da319c4361c3e8656b5b7055011e3</id>
<content type='text'>
  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.)
</content>
</entry>
<entry>
<title>Rewrite function attributes to use the generic routines properly.</title>
<updated>2001-09-17T23:46:56Z</updated>
<author>
<name>Guido van Rossum</name>
<email>guido@python.org</email>
</author>
<published>2001-09-17T23:46:56Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=d9d1d4ac6fda7f4c898b55194be37b03b89450e9'/>
<id>urn:sha1:d9d1d4ac6fda7f4c898b55194be37b03b89450e9</id>
<content type='text'>
This uses the new "restricted" feature of structmember, and getset
descriptors for some of the type checks.
</content>
</entry>
<entry>
<title>Test the new semantics for setting and deleting a function's __dict__</title>
<updated>2001-08-14T18:28:28Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2001-08-14T18:28:28Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=033daa49eafae52f0b88085117e1bdf1cff2fe16'/>
<id>urn:sha1:033daa49eafae52f0b88085117e1bdf1cff2fe16</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Additional tests for current, PEP described semantics:</title>
<updated>2001-02-26T18:07:26Z</updated>
<author>
<name>Barry Warsaw</name>
<email>barry@python.org</email>
</author>
<published>2001-02-26T18:07:26Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=c1e100f2154810c173bc53015e0b9eabbce56555'/>
<id>urn:sha1:c1e100f2154810c173bc53015e0b9eabbce56555</id>
<content type='text'>
- 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.
</content>
</entry>
<entry>
<title>Whitespace normalization.</title>
<updated>2001-02-09T20:17:14Z</updated>
<author>
<name>Tim Peters</name>
<email>tim.peters@gmail.com</email>
</author>
<published>2001-02-09T20:17:14Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=10fb3863994a7242dd6f86bf8d571d30338f2061'/>
<id>urn:sha1:10fb3863994a7242dd6f86bf8d571d30338f2061</id>
<content type='text'>
</content>
</entry>
<entry>
<title>The one thing I love more then writing code is deleting code.</title>
<updated>2001-01-29T06:21:17Z</updated>
<author>
<name>Moshe Zadka</name>
<email>moshez@math.huji.ac.il</email>
</author>
<published>2001-01-29T06:21:17Z</published>
<link rel='alternate' type='text/html' href='http://dangofactory.net/cgit/cgit.cgi/Server/python.git/commit/?id=497671e094b7f18221cc1f872bfe68afc57c860b'/>
<id>urn:sha1:497671e094b7f18221cc1f872bfe68afc57c860b</id>
<content type='text'>
* 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
</content>
</entry>
</feed>
