Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
write method element
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn authored and behackl committed Jan 29, 2015
1 parent 886f495 commit 143dfea
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/sage/data_structures/mutable_poset.py
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,31 @@ def shell(self, key):
return self._shells_[key]


def element(self, key):
r"""
Return the element corresponding to ``key``.
INPUT:
``key`` -- the key of an object.
OUTPUT:
An object.
EXAMPLES::
sage: from sage.data_structures.mutable_poset import MutablePoset as MP
sage: P = MP()
sage: P.add(42)
sage: e = P.element(42); e
42
sage: type(e)
<type 'sage.rings.integer.Integer'>
"""
return self._shells_[key].element


def get_key(self, element):
r"""
Return the key corresponding to the given element.
Expand Down

0 comments on commit 143dfea

Please sign in to comment.