Full reproducer, showing that even though Object is the same reference in all namespaces it can have different constants in different namespaces, but only if calling constants in that namespace:
$ RUBY_NAMESPACE=1 ruby -ve 'ns = Namespace.new; File.write "ns.rb", "O = Object; OC = Object.constants"; ns.require "./ns"; p Object.equal?(ns::O); p Object.constants == ns::OC; p Object.constants == ns::Object.constants'
ruby 3.5.0dev (2025-05-10T07:50:29Z namespace-on-read-.. bd4f57f96b) +PRISM [x86_64-linux]
ruby: warning: Namespace is experimental, and the behavior may change in the future!
See doc/namespace.md for know issues, etc.
true
false
true
I think this is expected behavior for Namespace so not sure it's worth reopening.
It does mean that with Namespace even though two objects (specifically core classes and modules) might be equal they are actually different when looked at in different namespaces.