From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on starla X-Spam-Level: X-Spam-Status: No, score=-1.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; unprotected) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=Q+hX4gpH; 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=c3X5JEts; dkim-atps=neutral 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) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 559531F4EF for ; Sat, 30 Aug 2025 02:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1756520066; bh=tNRvdnMSllljWFiTaaTyjBzRokV7IQ5xk6OluOTD/tM=; h=Date:References:To:Reply-To:Subject:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From:Cc:From; b=Q+hX4gpHhuEEJYWVrZZemWQB1i/GROgneXfFUg93tlqLmNMp8iG2COdYakNJCZtl0 q6/8/DZp/e5gTKvVxHen+NNx9E3q7E8czQMvS3sYfsgAql5ROJaZUv+DAa0rm/8myy DEvYv6OCkxVgeE1U+gQczSTPPSs2gTmOlR5vjtIc= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id CB03248DEA for ; Sat, 30 Aug 2025 02:14:26 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=ruby-lang.org header.i=@ruby-lang.org header.a=rsa-sha256 header.s=s1 header.b=c3X5JEts; dkim-atps=neutral Received: from s.wrqvtvvn.outbound-mail.sendgrid.net (s.wrqvtvvn.outbound-mail.sendgrid.net [149.72.120.130]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E8DBE479FD for ; Sat, 30 Aug 2025 02:13:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruby-lang.org; h=date:from:references:subject:mime-version:content-type: content-transfer-encoding:list-id:to:cc:content-type:date:from:subject:to; s=s1; bh=aOczgWEqyCsyN7idGg3dBNOrY8pb+TZA9D7kKOvAWBw=; b=c3X5JEtsl9TJWeIFxHkmfDGuiAcp/mHv/5C4ai5U8I9nN5dsWRcZE72Qtgs85GlGgLQ3 KShoEBIwZhpYfkIUJCEVNisLI9GAwo/P39wnVz7xeVrM5msnFIzO508sauCu/aQo08mq0j s688Tejl/SCZ4gnJ2ZMS/zte+ouJS+vERTVE9pq3QAfqpUedzgkEl5WVRAOTKliXOgAKM7 DiYOdseG3YWKrU5z4P4NrrzHZw4ax6Y6jVafKCXfZx1jPnTOJDghYjYF8bW3LviCgCbo/t UarJgPB3Sr9fCyQorqika5OxmIGzhShOj0v5ktop4Dtvj/oOjvpkEuGf7Rtgm7Zg== Received: by recvd-7f4fb8995-mlp7m with SMTP id recvd-7f4fb8995-mlp7m-1-68B25E41-21 2025-08-30 02:13:21.786990438 +0000 UTC m=+7464537.310854728 Received: from herokuapp.com (unknown) by geopod-ismtpd-0 (SG) with ESMTP id ZNMKbc7-SgiAU99mQNNZEg for ; Sat, 30 Aug 2025 02:13:21.754 +0000 (UTC) Date: Sat, 30 Aug 2025 02:13:21 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 21538 X-Redmine-Issue-Author: chucke X-Redmine-Issue-Priority: Normal X-Redmine-Sender: jeremyevans0 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: 99940 X-SG-EID: =?us-ascii?Q?u001=2ELyyp8a6L4BPdoBZ5kcNQuEdalXgUnCKLcPykf2c9d2sTWfvALBzqM4Ij+?= =?us-ascii?Q?Jg9Prp2eVDkf9lIZhzc05KfUT4Npfgnigb95d+v?= =?us-ascii?Q?hGuAMoCQYcJ5kL7PnV1O8koNLP5Vw3jLuPLY3wt?= =?us-ascii?Q?OkweYpeNEObe=2FWxR=2FCLrRxQ8QuwfwEhpGYVBx2c?= =?us-ascii?Q?LW42YjXVDKUxGkKPUzXIqzGTP3iRwDy7Q7=2F2R=2Ff?= =?us-ascii?Q?BycfNLbtPLgGh79=2FC3Y7Wf4iC7iVWmR+SOKvZrc?= =?us-ascii?Q?AHo8auRWKhU338htYmuxmLHFdA=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: F7LAJCM47IDXU6JKYWKNDLU7YTQ7PQEF X-Message-ID-Hash: F7LAJCM47IDXU6JKYWKNDLU7YTQ7PQEF X-MailFrom: bounces+313651-b711-ruby-core=ml.ruby-lang.org@em5188.ruby-lang.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: Ruby developers Subject: [ruby-core:123133] [Ruby Bug#21538] initialize_dup not called when duping class/module List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: "jeremyevans0 (Jeremy Evans) via ruby-core" Cc: "jeremyevans0 (Jeremy Evans)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21538 has been updated by jeremyevans0 (Jeremy Evans). I found a simple fix for all issues: https://github.com/ruby/ruby/pull/14412 ---------------------------------------- Bug #21538: initialize_dup not called when duping class/module https://bugs.ruby-lang.org/issues/21538#change-114460 * Author: chucke (Tiago Cardoso) * Status: Open * ruby -v: 3.4.5 * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Not sure whether this is expected behaviour or not, but just leaving it here to start the debate on whether callbacks like `initialize_dup` are supposed to be called when a module or class is duped (the same happens with `initialize_copy` and `initialize_clone` btw): class A def initialize_dup(_) puts "dup instance" super end def self.initialize_dup(_) puts "dup class" super end end A.new.dup #=> "dup instance" A.dup #=> nothing -- 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/lists/ruby-core.ml.ruby-lang.org/