From: Hal Fulton Date: 2003-12-09T05:13:40+09:00 Subject: Re: subclassing Errno::XXX Dave Thomas wrote: > > On Dec 8, 2003, at 2:47, Yukihiro Matsumoto wrote: > >> I'm not sure what you mean. Do you mean when MissingFileError >> inherits from Errno::ENOENT, it should inherit Errno constat from >> Errno::ENOENT as well? > > > I'm not addressing Nobu's point, but there is an argument to say that > there is no meaningful inheritance at all if you _change_ Errno: that > is, if you subclass an Errno::Xxx, the Errno constant in the subclass > must be identical to that in the parent (otherwise it isn't a true > subclass). After all, these classes are essentially wrappers for the > Errno value, and so for a subclass to maintain the "isa" relationship it > must wrap the same value too. If that's the case, maybe it should be a reader class method wrapping an anonymous constant? Hal