]> granicus.if.org Git - python/commitdiff
Issue #4395: Better testing and documentation of binary operators.
authorRobert Collins <rbtcollins@hp.com>
Thu, 6 Aug 2015 22:32:15 +0000 (10:32 +1200)
committerRobert Collins <rbtcollins@hp.com>
Thu, 6 Aug 2015 22:32:15 +0000 (10:32 +1200)
Patch by Martin Panter.

1  2 
Doc/reference/datamodel.rst
Lib/test/test_binop.py
Misc/NEWS

Simple merge
index 31dc785e478be1d0314f5819244e1c3aa07eeb20,963aa01b6ce535320b13499550b4dda5796061fb..823740c4449ffa38b4cc7e5030c9d94d9b802d59
@@@ -369,5 -384,14 +384,10 @@@ class OperationOrderTests(unittest.Test
          self.assertEqual(op_sequence(le, B, C), ['C.__ge__', 'B.__le__'])
          self.assertEqual(op_sequence(le, C, B), ['C.__le__', 'B.__ge__'])
  
 -def test_main():
 -    support.run_unittest(RatTestCase, OperationOrderTests)
 -
 -
+         self.assertTrue(issubclass(V, B))
+         self.assertEqual(op_sequence(eq, B, V), ['B.__eq__', 'V.__eq__'])
+         self.assertEqual(op_sequence(le, B, V), ['B.__le__', 'V.__ge__'])
  if __name__ == "__main__":
 -    test_main()
 +    unittest.main()
diff --cc Misc/NEWS
index eada032edfcb57098e461f419dfdb5bad27212bd,795ace7452580175f6de1a8beaf3e66c637a4edf..5fefcdbaae7509dfd5b41ab30e1a53c9adea26d7
+++ b/Misc/NEWS
@@@ -10,92 -10,98 +10,95 @@@ Release date: 2015-08-0
  Core and Builtins
  -----------------
  
 -- Issue #24467: Fixed possible buffer over-read in bytearray. The bytearray
 -  object now always allocates place for trailing null byte and it's buffer now
 -  is always null-terminated.
 +Library
 +-------
 +
+ - Issue #4395: Better testing and documentation of binary operators.
+   Patch by Martin Panter.
 +- Issue #23973: Update typing.py from GitHub repo.
  
 -- Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
 -  PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
 -  to check for and handle errors correctly.
 +- Issue #23004: mock_open() now reads binary data correctly when the type of
 +  read_data is bytes.  Initial patch by Aaron Hill.
  
 -- Issue #24257: Fixed system error in the comparison of faked
 -  types.SimpleNamespace.
 +- Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.
  
 -- Issue #22939: Fixed integer overflow in iterator object.  Patch by
 -  Clement Rouault.
 +- Issue #23652: Make it possible to compile the select module against the
 +  libc headers from the Linux Standard Base, which do not include some
 +  EPOLL macros.  Patch by Matt Frank.
  
 -- Issue #23985: Fix a possible buffer overrun when deleting a slice from
 -  the front of a bytearray and then appending some other bytes data.
 +- Issue #22932: Fix timezones in email.utils.formatdate.
 +  Patch from Dmitry Shachnev.
  
 -- Issue #24102: Fixed exception type checking in standard error handlers.
 +- Issue #23779: imaplib raises TypeError if authenticator tries to abort.
 +  Patch from Craig Holmquist.
  
 -- Issue #23757:  PySequence_Tuple() incorrectly called the concrete list API
 -  when the data was a list subclass.
 +- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
 +  written by Matthieu Gautier.
  
 -- Issue #24407: Fix crash when dict is mutated while being updated.
 +- Issue #23254: Document how to close the TCPServer listening socket.
 +  Patch from Martin Panter.
  
 -- Issue #24096: Make warnings.warn_explicit more robust against mutation of the
 -  warnings.filters list.
 +- Issue #19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
  
 -- Issue #23996: Avoid a crash when a delegated generator raises an
 -  unnormalized StopIteration exception.  Patch by Stefan Behnel.
 +- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
  
 -- Issue #24022: Fix tokenizer crash when processing undecodable source code.
 +- Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
 +  Patch by Gustavo J. A. M. Carneiro.
  
 -- Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
 -  while it is holding a lock to a buffered I/O object, and the main thread
 -  tries to use the same I/O object (typically stdout or stderr).  A fatal
 -  error is emitted instead.
 +- Issue #24791: Fix grammar regression for call syntax: 'g(*a or b)'.
  
 -- Issue #22977: Fixed formatting Windows error messages on Wine.
 -  Patch by Martin Panter.
 +Documentation
 +-------------
  
 -- Issue #23803: Fixed str.partition() and str.rpartition() when a separator
 -  is wider then partitioned string.
 +- Issue #24129: Clarify the reference documentation for name resolution.
 +  This includes removing the assumption that readers will be familiar with the
 +  name resolution scheme Python used prior to the introduction of lexical
 +  scoping for function namespaces. Patch by Ivan Levkivskyi.
  
 -- Issue #23192: Fixed generator lambdas.  Patch by Bruno Cauet.
 +- Issue #20769: Improve reload() docs. Patch by Dorian Pula.
  
 -- Issue #23629: Fix the default __sizeof__ implementation for variable-sized
 -  objects.
 +- Issue #23589: Remove duplicate sentence from the FAQ.  Patch by Yongzhi Pan.
  
 -- Issue #24044: Fix possible null pointer dereference in list.sort in out of
 -  memory conditions.
 +- Issue #24729: Correct IO tutorial to match implementation regarding
 +  encoding parameter to open function.
  
 -- Issue #21354: PyCFunction_New function is exposed by python DLL again.
 +Tests
 +-----
  
 -- Issue #23812: Fix asyncio.Queue.get() to avoid loosing items on cancellation.
 -  Patch by Gustavo J. A. M. Carneiro.
 +- Issue #24751: When running regrtest with the ``-w`` command line option,
 +  a test run is no longer marked as a failure if all tests succeed when
 +  re-run.
  
 -Library
 --------
  
 -- Issue #23888: Handle fractional time in cookie expiry. Patch by ssh.
 +What's New in Python 3.5.0 beta 4?
 +==================================
  
 -- Issue #23004: mock_open() now reads binary data correctly when the type of
 -  read_data is bytes.  Initial patch by Aaron Hill.
 +Release date: 2015-07-26
  
 -- Issue #23652: Make it possible to compile the select module against the
 -  libc headers from the Linux Standard Base, which do not include some
 -  EPOLL macros.  Patch by Matt Frank.
 +Core and Builtins
 +-----------------
  
 -- Issue #22932: Fix timezones in email.utils.formatdate.
 -  Patch from Dmitry Shachnev.
 +- Issue #23573: Restored optimization of bytes.rfind() and bytearray.rfind()
 +  for single-byte argument on Linux.
  
 -- Issue #23779: imaplib raises TypeError if authenticator tries to abort.
 -  Patch from Craig Holmquist.
 +- Issue #24569: Make PEP 448 dictionary evaluation more consistent.
  
 -- Issue #23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
 -  written by Matthieu Gautier.
 +- Issue #24583: Fix crash when set is mutated while being updated.
  
 -- Issue #23254: Document how to close the TCPServer listening socket.
 -  Patch from Martin Panter.
 +- Issue #24407: Fix crash when dict is mutated while being updated.
  
 -- Issue #19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
 +- Issue #24619: New approach for tokenizing async/await. As a consequence,
 +  is is now possible to have one-line 'async def foo(): await ..' functions.
  
 -- Issue #23441: rcompleter now prints a tab character instead of displaying
 -  possible completions for an empty word.  Initial patch by Martin Sekera.
 +- Issue #24687: Plug refleak on SyntaxError in function parameters
 +  annotations.
  
 -- Issue #24735: Fix invalid memory access in
 -  itertools.combinations_with_replacement().
 +Library
 +-------
  
 -- Issue #17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
 +- Issue #23441: rcompleter now prints a tab character instead of displaying
 +  possible completions for an empty word.  Initial patch by Martin Sekera.
  
  - Issue #24683: Fixed crashes in _json functions called with arguments of
    inappropriate type.