
Issue #21316 has been updated by fxn (Xavier Noria). @ko1 yeah, in Ruby you can have two classes with the same permanent name today. You know that, but let me show an example for the archives: ```ruby c = Class.new C = c Object.send(:remove_const, :C) d = Class.new C = d p c.name == d.name # true ``` So, where possible, in arbitrary settings, you better work with class objects. But there are common scenarios (configuration, etc., I described a few above) in which you do not have the object and the natural way to refer to the class is by its name. Today, that is a common practice, and if you want to be able to load arbitrary code within a namespace, I think this has to be preserved. Otherwise, such code won't be loadable under a namespace. ---------------------------------------- Bug #21316: Namespaces leak with permanent names https://bugs.ruby-lang.org/issues/21316#change-113393 * Author: fxn (Xavier Noria) * Status: Open * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- Namespaces are not transparent for this program ```ruby C = Class.new C.name == 'C' ``` because under a non-main user namespace, the name of `C` has the namespace as a prefix. -- https://bugs.ruby-lang.org/