This repository has been archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from beojan/master
Add TParameter class
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import uproot_methods.base | ||
|
||
|
||
def _decode(seq): | ||
if isinstance(seq, bytes): | ||
return seq.decode("UTF-8") | ||
else: | ||
return seq | ||
|
||
|
||
class Methods(uproot_methods.base.ROOTMethods): | ||
def __repr__(self): | ||
if self._fName is None: | ||
return "<{0} at 0x{1:012x}>".format(_decode(self._classname), id(self)) | ||
else: | ||
return "<{0} {1} 0x{2:012x}>".format( | ||
_decode(self._classname), _decode(self._fName), id(self) | ||
) | ||
|
||
def __str__(self): | ||
return str(self._fVal) | ||
|
||
@property | ||
def name(self): | ||
return _decode(self._fName) | ||
|
||
@property | ||
def value(self): | ||
return self._fVal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters