Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

dynamically created methods are confusing for users #233

Open
HDembinski opened this issue Feb 19, 2020 · 1 comment
Open

dynamically created methods are confusing for users #233

HDembinski opened this issue Feb 19, 2020 · 1 comment

Comments

@HDembinski
Copy link
Member

I am teaching about uproot and I found that several methods on a jagged array do not seem to exist, but they can be accessed anyway.

# x is a JaggedArray
dir(x)
['__class__',
 '__delattr__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__get__',
 '__getattribute__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__le__',
 '__lt__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__self__',
 '__self_class__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 '__thisclass__',
 '_content',
 '_counts',
 '_isvalid',
 '_offsets',
 '_parents',
 '_starts',
 '_stops',
 'leafcount']

But x.content, x.starts, etc. can be accessed.

@jpivarski
Copy link
Member

Adding a note to this issue: the properties (content, starts) are not dynamically created, but there is a __dir__ that is intended to add field names (which are dynamically added because they depend on the data). The __dir__ might not be accounting for the primary methods properly.

@jpivarski jpivarski transferred this issue from scikit-hep/uproot3 Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants