From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: ** X-Spam-Status: No, score=2.4 required=3.0 tests=BODY_8BITS,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI, PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 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 CE71E1F55F for ; Mon, 2 Oct 2023 15:00:47 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=ml.ruby-lang.org header.i=@ml.ruby-lang.org header.a=rsa-sha256 header.s=mail header.b=jgl2ryVI; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=D0B5zn8n; dkim-atps=neutral Received: from nue.mailmanlists.eu (localhost [127.0.0.1]) by nue.mailmanlists.eu (Postfix) with ESMTP id 6182980493; Mon, 2 Oct 2023 15:00:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ml.ruby-lang.org; s=mail; t=1696258833; bh=IpZNfpm/NRaPRtOvT3Y83iuIqumiy0Fyd66P60TWmP4=; h=References:In-Reply-To:Date:To:Reply-To:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From:Cc:From; b=jgl2ryVINAsSYbRvHD1GtPvpS2KohRPOf3BQXz38P4kJteRBfZDqqmQSVbEu+Yc3z CrIWpnaiP9L4Nlu8stfIvB9hE8PiRvXAwG4WqjOaCEdyRzTWSCEs8iqFYYxlNd14E0 XNGBA26MJ7IBGw66DalOlXvOP++3qzE2rs4YkWLE= Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by nue.mailmanlists.eu (Postfix) with ESMTPS id E6E6680484 for ; Mon, 2 Oct 2023 15:00:30 +0000 (UTC) Authentication-Results: nue.mailmanlists.eu; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=D0B5zn8n; dkim-atps=neutral Received: by mail-qt1-x844.google.com with SMTP id d75a77b69052e-4197fa36b6aso19295311cf.3 for ; Mon, 02 Oct 2023 08:00:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696258829; x=1696863629; darn=ml.ruby-lang.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=0nmC2tjhgqtyO3CGloPVYeRSsc041ZLuHeFM1kWhINA=; b=D0B5zn8ntp/BlBM0UoTtdG8MGgt2GBVe1IVzQYqvOpGIpbSjhypjkanqTR6WX0mXTt FFBZt7YSSD3yHcD8IDlx6t8EVaTO2C7pt0VPE6rAObWw586WbwrdK+oPGk/N4STXWZkv oUVM3xKAF+zG4hR36rj1Yf7n3NXOeHXD1x2+yU20G3bUr/Ww7rF2NPFgXSkRoQeSjjBg 759Sb7kt7J8DeW1Ry3/bNczLS30MHe22PeSDC/Gh5vAyT2W/Va4PztvyF36DeR00zOdG CtkoSnmoGuLjsPmMhZzROc85Gk5Nhn0uq3hZAR7roxoRpMjmM/7t3qEAp0XzqZdhCNQr H7Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696258829; x=1696863629; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0nmC2tjhgqtyO3CGloPVYeRSsc041ZLuHeFM1kWhINA=; b=f+pincwpTSA+cZ2i4EBgx/B+mcKrK5HSWvZEVyUDKYloA2pIuFhzRtn3R1CDKtd3Y1 rs0c2Np51NIJ62AoMVHoa4ksRiANL9hcMkEhTVXOUXn0QLV2NH/dte5db9e0gSmffC/L GFqDbbdy1VfgwdteQBl2ft6LLPkDB2yBa8exHWbr/Xi4NxyqY2Z4tIR0zqzg1n2WjhE+ ePUiMoIvglObSU5ja5Gkod6gpE1H3l231WLi0TcwhWPmORrZovxNaj0sSMdu9bcOBpTB 8zGOeIoAAgYyg3+FsPFw0jtE5oh6PQAw4Dd9ShXQByB+d68eqSzyXFZIK8dXX8dGCNTc kmEQ== X-Gm-Message-State: AOJu0YzblKkh+fpgZ+Bil9zTENGZ1fPlD98rgjvEDhvPWG7dM6xNSU18 Llw7louZqDOzgADWkjEDklf+6bUh5xTJXOeHUxKOy69wLEQr7NHM X-Google-Smtp-Source: AGHT+IHF7f5O5Oxg0zpzB4vZXjtD0mben08e7vEhJlJ8wGnfOiP2SrcivQ5WUKPd9SDf5XXHZ0VPfI2FEpLxIKAD0ZU= X-Received: by 2002:ac8:5b51:0:b0:417:d4a4:a90a with SMTP id n17-20020ac85b51000000b00417d4a4a90amr10678133qtw.47.1696258829329; Mon, 02 Oct 2023 08:00:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 2 Oct 2023 21:00:18 +0600 Message-ID: To: Ruby developers Message-ID-Hash: QXYCWCBF3EQOZVIVVEAH2NU7FPHQUK3O X-Message-ID-Hash: QXYCWCBF3EQOZVIVVEAH2NU7FPHQUK3O X-MailFrom: alekseipriklonov@gmail.com 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:114941] Re: [Ruby master Feature#18915] New error class: NotImplementedYetError or scope change for NotImplementedError List-Id: Ruby developers Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: =?utf-8?b?0JDQu9C00LDQvSDQnNGD0YXQsNC90L7QsiB2aWEgcnVieS1jb3Jl?= Cc: =?UTF-8?B?0JDQu9C00LDQvSDQnNGD0YXQsNC90L7Qsg==?= Content-Type: multipart/mixed; boundary="===============5688660769256682917==" --===============5688660769256682917== Content-Type: multipart/alternative; boundary="000000000000f82ab10606bd08bf" --000000000000f82ab10606bd08bf Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =F0=9F=99=82=F0=9F=91=8D =D0=BF=D0=BD, 2 =D0=BE=D0=BA=D1=82. 2023=E2=80=AF=D0=B3. =D0=B2 19:12, zden= nis (Zach Dennis) via ruby-core < ruby-core@ml.ruby-lang.org>: > Issue #18915 has been updated by zdennis (Zach Dennis). > > File not-implemented-error-docs.patch added > > Whoops, last patch upload failed. Patch actually applied here. > > ---------------------------------------- > Feature #18915: New error class: NotImplementedYetError or scope change > for NotImplementedError > https://bugs.ruby-lang.org/issues/18915#change-104812 > > * Author: Quintasan (Micha=C5=82 Zaj=C4=85c) > * Status: Open > * Priority: Normal > ---------------------------------------- > # Abstract > > Introduce `NotImplementedYetError` exception that should be used in case > when the codepath has not been implemented by the developer for some reas= on > (maybe they're designing an abstract class or are designing some sort of > interface to reuse later on) OR extend the meaning of `NotImplementedErro= r` > to cover those usecases so we don't have to introduce another exception > > # Background > > `NotImplementedError` is supposed to be raised `if the underlying > operating system or Ruby runtime does not support them` ( > https://ruby-doc.org/core-3.1.2/NotImplementedError.html) > > However it appears that many people are misusing this exception by raisin= g > this in a superclass from which they later inherit from. I do realize tha= t > Ruby promotes duck-typing (the default RuboCop style guide has a cop for > this =E2=80=93 https://github.com/rubocop/ruby-style-guide#duck-typing). = However > I have seen this being discussed numerous times: > > * https://github.com/rubocop/ruby-style-guide/issues/458 > * http://chrisstump.online/2016/03/23/stop-abusing-notimplementederror/ > * > https://oleg0potapov.medium.com/ruby-notimplementederror-dont-use-it-dff1= fd7228e5 > * https://gitlab.com/gitlab-org/gitlab/-/issues/354314 (which I'm the > author of) > * https://github.com/rmosolgo/graphql-ruby/issues/2067 (here the author > actually confused it with Python's `NotImplementedError`) > * > https://stackoverflow.com/questions/13668068/how-to-signal-not-implemente= d-yet > > # Proposal > > Create `NotImplementedYetError` exception > > OR > > Allow raising `NotImplementedError` in cases other than OS or Ruby runtim= e > incompatibilities > > # Evaluation > > ### Add `NotImplementedYetError` > > I think a new exception is a better idea than changing the usage of an > existing one just because "everyone is using it". That said it would > require people to refactor their code which might prevent wider adoption = of > the new exception. > > ### Change scope of `NotImplementedError` > > This would require the least amount of changes possible (only a > documentation change) and I believe there would be no compatibility > problems whatsoever. > > ---Files-------------------------------- > not-implemented-error-docs.patch (0 Bytes) > not-implemented-error-docs.patch (1.57 KB) > > > -- > 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/ --000000000000f82ab10606bd08bf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
=F0=9F=99=82=F0=9F=91=8D

=D0=BF=D0=BD, 2 =D0=BE=D0=BA= =D1=82. 2023=E2=80=AF=D0=B3. =D0=B2 19:12, zdennis (Zach Dennis) via ruby-c= ore <ruby-core@ml.ruby-lan= g.org>:
I= ssue #18915 has been updated by zdennis (Zach Dennis).

File not-implemented-error-docs.patch added

Whoops, last patch upload failed. Patch actually applied here.

----------------------------------------
Feature #18915: New error class: NotImplementedYetError or scope change for= NotImplementedError
https://bugs.ruby-lang.org/issues/18915#change-= 104812

* Author: Quintasan (Micha=C5=82 Zaj=C4=85c)
* Status: Open
* Priority: Normal
----------------------------------------
# Abstract

Introduce `NotImplementedYetError` exception that should be used in case wh= en the codepath has not been implemented by the developer for some reason (= maybe they're designing an abstract class or are designing some sort of= interface to reuse later on) OR extend the meaning of `NotImplementedError= ` to cover those usecases so we don't have to introduce another excepti= on

# Background

`NotImplementedError` is supposed to be raised `if the underlying operating= system or Ruby runtime does not support them` (https://ruby-doc.org/core-3.1.2/NotImplementedError.html)

However it appears that many people are misusing this exception by raising = this in a superclass from which they later inherit from. I do realize that = Ruby promotes duck-typing (the default RuboCop style guide has a cop for th= is =E2=80=93 https://github.com/rubocop/ruby-= style-guide#duck-typing). However I have seen this being discussed nume= rous times:

* https://github.com/rubocop/ruby-style-guide/= issues/458
* http://chrisstump.online/2016= /03/23/stop-abusing-notimplementederror/
* https://oleg0pota= pov.medium.com/ruby-notimplementederror-dont-use-it-dff1fd7228e5
* https://gitlab.com/gitlab-org/gitlab/-/issues/= 354314 (which I'm the author of)
* https://github.com/rmosolgo/graphql-ruby/issue= s/2067 (here the author actually confused it with Python's `NotImpl= ementedError`)
* https://stackoverflo= w.com/questions/13668068/how-to-signal-not-implemented-yet

# Proposal

Create `NotImplementedYetError` exception

OR

Allow raising `NotImplementedError` in cases other than OS or Ruby runtime = incompatibilities

# Evaluation

### Add `NotImplementedYetError`

I think a new exception is a better idea than changing the usage of an exis= ting one just because "everyone is using it". That said it would = require people to refactor their code which might prevent wider adoption of= the new exception.

### Change scope of `NotImplementedError`

This would require the least amount of changes possible (only a documentati= on change) and I believe there would be no compatibility problems whatsoeve= r.

---Files--------------------------------
not-implemented-error-docs.patch (0 Bytes)
not-implemented-error-docs.patch (1.57 KB)


--
https://bugs.ruby-lang.org/
=C2=A0______________________________________________
=C2=A0ruby-core mailing list -- ruby-core@ml.ruby-lang.org
=C2=A0To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
=C2=A0ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.o= rg/
--000000000000f82ab10606bd08bf-- --===============5688660769256682917== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ______________________________________________ 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/ --===============5688660769256682917==--