As the documentation says, getproperty is literally what is called when you do a.b. module do using Base automatically and therefore has all its exported symbols inside it (and Main is not exception to this), so they can be accessed with the dot notation and therefore getproperty. If anything, I think what is tripping you is the behavior of module not of getproperty.
It has? Every using (even the implicit using Base) make all exported names properties of the importer/user module. They are just not their own properties, and so hasproperty ignores them. Maybe hasproperty should be renamed hasownproperty you mean? Or maybe hasproperty should not restrict itself just to owned properties?
Yes, exactly, something like hasownproperty would be less confusing. Because intuitively getproperty(module, prop) should return property if and only if hasproperty(module, prop) is true
I think the fact that getproperty(module, prop) does not conflate
the module.prop or struct.prop with hasproperty(module, prop) is a good thing.
It allows for overload of the . syntax
You can add props lazily, on-demand, or even self-vivifying
Keeping the functionality explicit and composable is a strength of Julia
julia> struct X end
julia> getproperty(X, :b)
ERROR: type DataType has no field b
Stacktrace:
[1] getproperty(x::Type, f::Symbol)
@ Base .\Base.jl:28
[2] top-level scope
@ REPL[3]:1
julia> hasproperty(X, :b)
false
You can see there is an error if getproperty(module, prop) is used with a non-existent prop. Having some alternate return value for this case seems an unnecessary extra step.
I do not see how any of your three points stem from the lack of conflation.
How conflating would hinder overload? Asking for consistency does not hinder overload.
Again, this is not hindered in any way, so?
What does this has to do with the problem at hand? Why it would lack explicitness or composability to, for example, have a separate hasproperty and hasownproperty?
You example does not call getproperty(module, prop) it calls getproperty(object, prop) so I am not sure if I understand its purpose.