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=y44iIl3Z; 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=raGRbViO; 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 B7F8D1F4EF for ; Mon, 11 Aug 2025 13:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1754918840; bh=gwK8bFKnqbs27LVw8C4ZO9UvXJA1PHpwXfGWBpi1fT8=; 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=y44iIl3ZN8BvKFYR5ewmR48gRQXwmBJjQN+CpiBkQVYmrGBqNsTYg1NJir6e47anc fjodM3Kzqv3hB+sCi28fW20JShK08uiF99sK3odQO11jhIckQ0t5EifK60HfwIizND guYbJEV2lWEwYdzdsMA7ohxTqAaf+EgjtqoEVKyY= Received: from nue.mailmanlists.eu (localhost [IPv6:::1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 1B8D748566 for ; Mon, 11 Aug 2025 13:27:20 +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=raGRbViO; dkim-atps=neutral Received: from s.wrqvwxzv.outbound-mail.sendgrid.net (s.wrqvwxzv.outbound-mail.sendgrid.net [149.72.154.232]) by nue.mailmanlists.eu (Postfix) with ESMTPS id 5A0554841D for ; Mon, 11 Aug 2025 13:26:25 +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=mim8s5/AplBRm82ZdaiWhCGS1M3c0Z8KdfsKseoDXDA=; b=raGRbViOdp9HMKy9SqPGwM+vqKa8yHksBX1ttTIo6aPHb2990tfCnLpEIbMP8s7ZOGem 6ywjvAfmtTgJSq4HLcjEuoyWf+kQuEKM5to3kfIlPiobo2LPDew3PuMlUcbyBZV3K32hEm D89KKS1LMwqfyoF6kPjPgoPeAr7oYULcHCfQayB5GyBbDkicn0A+YBwZW0BjHv9P1rwj5H lKSlVGIxOke7u6qm+yQlcP3BufPJFERoLwSQAUK2XNh/hGJCe+OrlEYhZI8hhvmAdG07N4 e9VuPDuo4hH834YeAgIJQeeydlo/gh+3jezeCNG7fvMLCE+vV+bZi1+CCURU0xWQ== Received: by recvd-7fd96f4944-2p2p4 with SMTP id recvd-7fd96f4944-2p2p4-1-6899EF7F-35 2025-08-11 13:26:23.851553511 +0000 UTC m=+5863328.428716339 Received: from herokuapp.com (unknown) by geopod-ismtpd-10 (SG) with ESMTP id g-sjfn58QlODQahTGhksBQ for ; Mon, 11 Aug 2025 13:26:23.788 +0000 (UTC) Date: Mon, 11 Aug 2025 13:26:23 +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: chucke 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: 99763 X-SG-EID: =?us-ascii?Q?u001=2EKk9t0ITOMZZZzjJcIQFb0FOVT+fNQ73YaOVO14KwYPhWI1B=2FBKzxVN4zt?= =?us-ascii?Q?B44Y6qRJTMCaD4jBHS95yKvzXQGiKKf8ZHZGT=2F+?= =?us-ascii?Q?tpqLqgKCINLEbGJqc3uRgpKciISgXaUNPCBGY6Q?= =?us-ascii?Q?5L=2FEpYtguzKWobPXPt3NLOHPg97nSUTnBkGUexB?= =?us-ascii?Q?WqfFDvzYhtDVSjqH94ZdW3GyXwbJGuDbZ4nAJqD?= =?us-ascii?Q?rIkfuaBOaWnyIFchMuRh+COdpjgufHWbjjA6EPQ?= =?us-ascii?Q?jwwUgNIeU22EDtBB6VpYVDdzRQ=3D=3D?= To: ruby-core@ml.ruby-lang.org X-Entity-ID: u001.I8uzylDtAfgbeCOeLBYDww== Message-ID-Hash: R4Z2DCNROWAXFQUAURBLC7PQWHMDCWF6 X-Message-ID-Hash: R4Z2DCNROWAXFQUAURBLC7PQWHMDCWF6 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:122945] [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: "chucke (Tiago Cardoso) via ruby-core" Cc: "chucke (Tiago Cardoso)" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Issue #21538 has been reported by chucke (Tiago Cardoso). ---------------------------------------- Bug #21538: initialize_dup not called when duping class/module https://bugs.ruby-lang.org/issues/21538 * 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/