summaryrefslogtreecommitdiff
path: root/src/zope/proxy
Commit message (Collapse)AuthorAgeFilesLines
* Configuring for c-codeMarius Gedminas2022-09-121-0/+29
| | | | | | Add a regression test for CFLAGS not having -Ofast, which is known to break things. See https://github.com/zopefoundation/meta/pull/155 for reference.
* Fix PyPy2 run on GHA. (#52)Michael Howitz2022-07-085-11/+19
| | | * isort lines.
* Python 3.11 foreward compatibilty.Michael Howitz2021-11-191-2/+3
| | | | The Python 2.7 variant was dropped there.
* Fix more deprecation warnings.Michael Howitz2021-07-151-6/+3
|
* Lint the code.Michael Howitz2021-07-155-105/+221
| | | | * Add support for Python 3.9.
* Don't set tp_print/tp_vectorcall_offset on Python 3.issue36Jason Madden2020-01-201-0/+7
| | | | | | | | In 3.8 it produces a compilation warning, in earlier versions it is ignored. Normalize ReST headings when adding the change note. Publish changes on RTD.
* Fix error handling in the tp_setattro slotMarius Gedminas2019-06-271-1/+1
| | | | | | The docs say this callback is supposed to return -1 on error. Fixes #30.
* Simplify getting the char* in get/setattro for clarity and performanceJason Madden2017-11-071-46/+11
| | | | | | | | | | | | | | | | | | | | | | | | Under Python 2, we were doing PyUnicode_check->PyUnicode_AsEncodedString->PyString_Check->PyString_ASSTRING. This can be simplified to PyString_AsString(). Internally it does the same unicode check if needed. It produces a better error message if the object is not a string or unicode. It is able to use the *cached* byte string, and it doesn't allocate a new object. Because we don't allocate a new object (sometimes) anymore, the extra INCREF/DECREF can go away. We're also able to drop one type check. Under Python 3, we were doing PyUnicode_Check->PyUnicode_AsUTF8String -> PyBytes_AS_STRING. This can be simified to PyUnicode_AsUTF8. This avoids an intermediate object and can use the cached byte string. We can also drop the extra INCREF/DECREF since we don't ever have a new object. Python 2 docs claimed that the underlying tp_getattro slots need a string object, but the unicode->string handling is done internally in Python's PyObject_GetAttr now, AFAICS. (It's difficult to get a unicode object in to these methods in the first place; someone must be explicitly calling the __getattribute__ dunder method.)
* Untrack self when deallocating.KIMURA Chikahiro2017-09-131-0/+1
| | | | Fixes #20
* Fix indexing pure-Python proxies on Py3, and restore __getslice__ on Py2issue21Jason Madden2017-09-123-43/+120
| | | | | | | | | Fixes #21. This removes the special cases for lists and tuples in the C code (but requires an #if Python 2 block). Tests are added (and generalized for Python 3). I verified that this fixes the issues observed in the zope.security tests.
* Use the right security proxy when testing C removeAllProxiesdoctest-all-the-thingsJason Madden2017-07-111-2/+4
| | | | This fixes the failure in test_security_proxy.
* 100% coverageJason Madden2017-07-113-108/+97
| | | | | | | | | | | | | Enable coveralls to report on this. Coverage reports showed two test classes that weren't subclassing the correct base class, so we weren't actually testing the C implementation of `removeAllProxies` and `queryInnerProxy`. Fixing this revealed a probably bug in the implementation of `removeAllProxies`; right now that test is skipped. Also remove the `test_suite` for 'python setup.py test' since it usually doesn't work anymore. See #18.
* Make py_sameProxiedObjects handle zope.security proxiesissue15Jason Madden2017-04-162-28/+28
| | | | | | By effectively bypassing them to access `_wrapped`. Fixes #15.
* Skip tests dependent on zope.security if it is missing.Tres Seaver2016-05-091-0/+8
|
* Fix removing pure python security proxiesBrian Sutherland2016-05-052-1/+12
| | | | The test is simple but requires zope.security to be installed. I chose that over writing the test in zope.security
* Workaround bizarre bug in PyPy 2.5.0 where proxys around types cannot be ↵Jason Madden2015-05-281-5/+19
| | | | correctly hashed.
* Fix looking up interfaces implemented/providedBy proxies around builtin ↵Jason Madden2015-05-282-2/+80
| | | | types (in pure-Python.).
* Make subclasses of ProxyBase delegate __module__ to the wrapped object. Also ↵Jason Madden2015-05-283-5/+95
| | | | fix differences between the C and Python implementations in handling __module__, whether or not a subclass is involved.
* Merge branch 'int-and-float' of git://github.com/NextThought/zope.proxy into ↵Tres Seaver2015-05-193-28/+94
|\ | | | | | | NextThought-int-and-float
| * Move the new tests to try to avoid a conflict with the previous PR.Jason Madden2015-05-071-65/+64
| |
| * Make the C implementation proxy __unicode__, and make it use the standard ↵Jason Madden2015-05-073-29/+95
| | | | | | | | methods to proxy int and float. Fixes #3 and Fixes #4.
* | Make it easier to subclass PyProxyBase using multiple-inheritance. This will ↵Jason Madden2015-05-082-13/+37
| | | | | | | | let zope.container._proxy reuse all the fixes in this branch.
* | Fix getting methods as attributes.Jason Madden2015-05-072-2/+18
| |
* | zope.container._proxy relied on the implementation detail of PyNonOverridable.Jason Madden2015-05-071-0/+5
| |
* | Handle descriptors defined in PyProxyBase subclasses the same way the C ↵Jason Madden2015-05-073-29/+158
|/ | | | version does. This fixes #5.
* - Fixed ``PyProxyBase.__iter__()`` to return the result ofStephan Richter2013-03-112-3/+35
| | | | | | | | | ``PyProxyBase._wrapped.__iter__`` if available, otherwise fall back to Python internals. The previous implementation always created a generator. - Fixed ``PyProxyBase.__setattr__()`` to allow setting of properties on the proxy itself. This is needed to properly allow proxy extensions as was evidenced int he ``zope.security.decorator`` module.
* Replace use of ``PyCObject`` APIs with equivalent ``PyCapsule`` APIs,Tres Seaver2012-12-192-4/+11
| | | | | | | | | | | | | except under Python 2.6. N.B. This change is an ABI incompatibility under Python 2.7: extensions built under Python 2.7 against 4.0.x versions of ``zope.proxy`` must be rebuilt. Bump target version to '4.1.0' to signal BBB issue. Enable compilation of dependent modules under Py3k.
* Fix tests which break under Python 3.3 due to '__qualname__'.Tres Seaver2012-11-211-2/+2
|
* Avoid 'p' as a variable name for debugging ease.Tres Seaver2012-11-211-49/+50
|
* Add test for DSD providing both instances' interfaces and its own.Tres Seaver2012-06-071-14/+53
|
* Moar tests for lying about '__class__' in pure Python.Tres Seaver2012-06-061-6/+12
|
* Restore tests for lying about '__class__' in pure Python.Tres Seaver2012-06-062-14/+17
| | | | Now that we have the gnarly '__getattribute__', we *can* tell that lie.
* Fix 'non_overridable' decorator under pure Python.Tres Seaver2012-06-062-3/+42
|
* Unused import.Tres Seaver2012-06-061-1/+0
|
* Moar Py3 compatibility.Tres Seaver2012-06-061-0/+3
|
* Py3 compatibility.Tres Seaver2012-06-061-1/+2
|
* Back out support for __reversed__.Tres Seaver2012-06-062-5/+10
| | | | Python 2.7 adds B&D checks which break for the C wrapper.
* Neaten slot names.Tres Seaver2012-06-061-88/+91
|
* Detabify.Tres Seaver2012-06-061-137/+137
|
* Remove pre-Python-2.6 BBB cruft.Tres Seaver2012-06-062-17/+0
|
* Add pure-Python fallback implementations of the proxy module API functions.Tres Seaver2012-06-062-86/+282
|
* Add pure-Python fallback implementation of zope.proxy.ProxyBase.Tres Seaver2012-06-063-272/+741
| | | | | This version passes all tests except the one which asserts that the proxy can lie about its '__class__', which can't be done in Python.
* No splat imports.Tres Seaver2012-06-061-1/+8
|
* Suppress nannyism under Python3.Tres Seaver2012-06-061-49/+49
|
* Further test cleanup.Tres Seaver2012-06-061-19/+7
|
* Moar coverage.Tres Seaver2012-06-062-367/+440
| | | | | | Move narrative doctests out to Sphinx. Convert non-narrative doctestss to unittests.
* Moar coverage (by eye).Tres Seaver2012-06-061-0/+25
|
* 100% unit test coverage.Tres Seaver2012-06-061-4/+61
|
* Add Sphinx documentationTres Seaver2012-06-061-61/+0
| | | | | Move doctest examples to API reference.
* Drop support for Python 2.4 and 2.5.Tres Seaver2012-05-181-9/+15
| | | | | | | Replace deprecated 'zope.interface.implements' usage with equivalent 'zope.interface.implementer' decorator.