Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

User experience: get metadata #131

Closed
peter1000 opened this issue May 26, 2015 · 3 comments
Closed

User experience: get metadata #131

peter1000 opened this issue May 26, 2015 · 3 comments
Labels

Comments

@peter1000
Copy link
Contributor

Just thought from a user experience the way of how to get metadata is a bit inconsistence.

function findmeta

  • Package's metadata: meta = getpackage(root).metadata
  • Module's metadata: meta = getmodule(m).metadata
  • object's metadata: meta = getmeta(m, obj)
    • getmeta(obj).metadata

or:

  • Package's metadata: meta = getpackage_meta(root)
  • Module's metadata: meta = getmodule_meta(m)
  • object's metadata: meta = getobj_meta(obj)

Which fits in to my question about obj meta

Just a thought maybe there is a way to make it for all 3 levels the same? Not necessarily my name suggestion though ;)

@MichaelHatherly
Copy link
Owner

The difference is that getmeta has to do some work to extract the metadata from a docstring, whereas ModuleData and PackageData objects don't.

I'm not a fan of the underscored names getpackage_meta, etc. as public method names. We should be using multiple dispatch to simplify it a bit. Perhaps:

getmeta(::PackageData)
getmeta(::ModuleData)
getmeta(::Module)
getmeta(::Module, ::Any)

How's that sound to you?

@peter1000
Copy link
Contributor Author

I'm not a fan of the underscored names

I know ;) that's why I wrote Not necessarily my name suggestion though

yep your suggestion looks from a user perspective more consistent than the current implementation

@MichaelHatherly
Copy link
Owner

Generic getmeta added here 9e930d8#diff-f09e69cbce12e451a81ba8365fb18c85R212.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants