From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS24940 94.130.0.0/16 X-Spam-Status: No, score=-2.9 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_BL_SPAMCOP_NET,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=no autolearn_force=no version=3.4.2 Received: from nue.mailmanlists.eu (nue.mailmanlists.eu [94.130.110.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 529491F4C1 for ; Thu, 1 Dec 2022 05:48:28 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.b="L6B+GGiC"; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 066737E5BA; Thu, 1 Dec 2022 05:48:22 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=L6B+GGiC; dkim-atps=neutral Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 837CC7E58B for ; Thu, 1 Dec 2022 05:48:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc; s=s1; bh=q5f59Oil69YIQ1r+AlPrIIoRBOHUts4auVJVAhuWJQQ=; b=L6B+GGiCw6wlq6W/g6l1P6GHDepXQSsQmRRHM+rZIVWZqn4s4uMkIzVg/w+4jf+5ohGE y8cfy4bPoHp1ISKmjT5bp6gmSyxyxR9ne1yZele9+VGhDgJBL8J5K/gcyOnujW4RcnKIhx fw0jgfIi7DpHTCmkozSZ8C3MoYSbR3Qii/Mzk0/Df3H6hJH9D5efzD+i7cinOd4rmrqDsf IHcX7tS7jVb2ONznfeqdCcweUMV3ZjDUxnd42e0Qr93HPlfXBatu358YoVfwUXq2rVw/s9 W22AwVOtfe2P5JFUhUqejhEYl0yEoRG4SiFfQIsJnDhKsJ876GpUU2aSwv6D+umg== Received: by filterdrecv-6b9548745c-hc4x9 with SMTP id filterdrecv-6b9548745c-hc4x9-1-6388401F-20 2022-12-01 05:48:15.944967893 +0000 UTC m=+1147204.509763524 Received: from herokuapp.com (unknown) by geopod-ismtpd-3-2 (SG) with ESMTP id Ab6pN2ZkSjaafWBWOZAQZQ for ; Thu, 01 Dec 2022 05:48:15.835 +0000 (UTC) Date: Thu, 01 Dec 2022 05:48:15 +0000 (UTC) From: "matz (Yukihiro Matsumoto)" Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 18798 X-Redmine-Issue-Author: ko1 X-Redmine-Sender: matz X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-Redmine-MailingListIntegration-Message-Ids: 87456 X-SG-EID: =?us-ascii?Q?SqOeWfVKFgkgw8cVgc6MYslIG5ZBbSbWU3opJ5u4yBsU3yWoizgPd1Pss4ZMTd?= =?us-ascii?Q?OLBRodnvQO26=2FFyqng1x72rdTkbmTHg5l1+yKA9?= =?us-ascii?Q?AQWjb6LQcXW4uq5aHBrGk0DF=2FWBlr9Gg9cZqjxz?= =?us-ascii?Q?IPpWhLTUe7c6FGeC=2FKV21KEpOmq3XMcnb1t6k07?= =?us-ascii?Q?AF2Dav33ph6dEOIZmuq=2FefieJ=2F3NIMuL0iSPo=2Fn?= =?us-ascii?Q?GhrhIM+lblVeMT0fkBPehqtgyvSrvWYdJcbqFRZ?= =?us-ascii?Q?SyMhRItjEN69vpRsLSpSQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== Message-ID-Hash: 2NAP4YYNRLIIFEOBOIBSNKDQJQUMKAWI X-Message-ID-Hash: 2NAP4YYNRLIIFEOBOIBSNKDQJQUMKAWI X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:111106] [Ruby master Feature#18798] `UnboundMethod#==` with inherited classes List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #18798 has been updated by matz (Yukihiro Matsumoto). LGTM. Matz. ---------------------------------------- Feature #18798: `UnboundMethod#==` with inherited classes https://bugs.ruby-lang.org/issues/18798#change-100374 * Author: ko1 (Koichi Sasada) * Status: Open * Priority: Normal ---------------------------------------- Now `UnboundMethod` for a same method from a superclass and an inherited class are not `==`. ```ruby class C def foo = :C $mc = instance_method(:foo) end class D < C $md = instance_method(:foo) end p $mc == $md #=> false p $mc.owner #=> C p $mc.owner == $md.owner #=> true p $mc.source_location == $md.source_location #=> true p $mc.inspect #=> "#" p $md.inspect #=> "#" ``` How about to make it `UnboundMethod#==` return true for this case? Rule: "return true if the UnboundMethod objects point to a same method definition" seems simple. FYI: On aliased unbound methods point to a same method are `==`. ```ruby class C def foo = :C alias bar foo $mfoo = instance_method(:foo) $mbar = instance_method(:bar) end p $mfoo, $mbar #=> # #=> # p $mfoo == $mbar #=> true ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/