Skip to content

Patch for feature request 491033 #40274

Closed

Description

@josiahcarlson
BPO 957240
Nosy @mwhudson, @loewis, @josiahcarlson
Files
  • asyncore_loop_with_doc_no_infinity.patch: Patch that doesn't use infinity
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mwhudson'
    closed_at = <Date 2004-06-30.09:07:17.000>
    created_at = <Date 2004-05-20.06:23:33.000>
    labels = []
    title = 'Patch for feature request 491033'
    updated_at = <Date 2004-06-30.09:07:17.000>
    user = 'https://github.com/josiahcarlson'

    bugs.python.org fields:

    activity = <Date 2004-06-30.09:07:17.000>
    actor = 'mwh'
    assignee = 'mwh'
    closed = True
    closed_date = None
    closer = None
    components = ['None']
    creation = <Date 2004-05-20.06:23:33.000>
    creator = 'josiahcarlson'
    dependencies = []
    files = ['5979']
    hgrepos = []
    issue_num = 957240
    keywords = ['patch']
    message_count = 13.0
    messages = ['46013', '46014', '46015', '46016', '46017', '46018', '46019', '46020', '46021', '46022', '46023', '46024', '46025']
    nosy_count = 3.0
    nosy_names = ['mwh', 'loewis', 'josiahcarlson']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue957240'
    versions = []

    Activity

    1. josiahcarlson commented on May 20, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      The attached patch is to offer the functionality
      desired by feature request: python.org/sf/491033

      On machines that use standard IEEE floating point
      doubles, the 'infinity' needs only to be 1e16 due to
      the limited precision of floating point. 1e309 is used
      for convenience sake, and will continue to be a
      precision infinity until 1024 bits of precision in
      floating point values is available. At such point in
      time where 1e309 is available in hardware, it will
      still sufficient due to the practical limitations of
      counting.

    2. josiahcarlson commented on May 20, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      Logged In: YES
      user_id=341410

      Sorry about that, I generated the patch by hand and got the
      ordering messed up.

    3. loewis commented on May 31, 2004

      loewismannequin
      Mannequin

      Logged In: YES
      user_id=21627

      This patch lacks changes to the documentation and the test
      suite.

    4. josiahcarlson commented on May 31, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      Logged In: YES
      user_id=341410

      The attached patch includes both a documentation patch, as
      well as a modified loop patch to explicitly match the
      documentation.

      The patches are concatenated and in standard context diff
      format (as per the Python patch submission guidelines, sorry
      about the previous unified diff). The test suite does not
      seem to contain tests for asyncore. It does contain a test
      for asynchat, which will be unaffected by this patch.

      One thing to note: the use of 'count = count - 1' rather
      than 'count -= 1' is to remove potential bugs in the case
      where a mutable number-like object with a modifying __isub__
      method were to be passed by a user.

    5. loewis commented on Jun 3, 2004

      loewismannequin
      Mannequin

      Logged In: YES
      user_id=21627

      Thanks for the patch. Applied as

      libasyncore.tex 1.15
      asyncore.py 1.51
      NEWS 1.986

    6. mwhudson commented on Jun 11, 2004

      @mwhudson

      Logged In: YES
      user_id=6656

      This patch should not have been accepted.

      Relying on a floating point infinity to marhsal/unmarshal correctly
      is a bad idea.

      With the aid of the LC_NUMERIC agnostism patch, this patch
      breaks test_asynchat *when asyncore.pyc exists*. I don't have a
      windows machine with a CVS HEAD Python to check, but if 2.3
      behaviour is retained, the upshot is that the count parameter will
      default to *1* if the code is loaded from a .pyc file.

    7. josiahcarlson commented on Jun 11, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      Logged In: YES
      user_id=341410

      If it would be preferred, I have an alternate patch against
      1.50 from CVS that uses None instead of floating point infinity.

    8. mwhudson commented on Jun 12, 2004

      @mwhudson

      Logged In: YES
      user_id=6656

      um, "yes". what's in CVS currently is not going to be there for
      very long.

    9. loewis commented on Jun 14, 2004

      loewismannequin
      Mannequin

      Logged In: YES
      user_id=21627

      I have backed out the patch in

      libasyncore.tex 1.16
      asyncore.py 1.52
      NEWS 1.1001

    10. josiahcarlson commented on Jun 14, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      Logged In: YES
      user_id=341410

      Y

    11. josiahcarlson commented on Jun 14, 2004

      josiahcarlsonmannequin
      MannequinAuthor

      Logged In: YES
      user_id=341410

      There is an attached patch that uses None. I ran the
      standard tests twice, and it does not fail when asyncore.pyc
      exists (5 tests should suffice).

    12. mwhudson commented on Jun 15, 2004

      @mwhudson

      Logged In: YES
      user_id=6656

      This is the patch I was trying to say was much better :-)

    13. mwhudson commented on Jun 30, 2004

      @mwhudson

      Logged In: YES
      user_id=6656

      Checked in the new version as

      Lib/asyncore.py revision 1.53
      Doc/lib/libasyncore.tex revision 1.17
      Misc/NEWS revision 1.1015

      Thanks!

    14. transferred this issue fromon Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions