"Vincent Davis" wrote
class BString(XString):
""" Biological string """
_bstring_constructor = biostrings.BString
@classmethod
def new(cls, x):
""" :param x: a (biological) string """
res = cls(cls._bstring_constructor(conversion.py2ri(x)))
_setExtractDelegato
"Vincent Davis" wrote
Take a look at the repr and str methods:
http://docs.python.org/reference/datamodel.html#basic-customization
Ok so I am still a little confused, It seems that __str__ is used for
print
and str()
That's right and repr() is used when evaluating the object, as at the >>
>
> That' a very strange idiom in Python.
> Can you show us the class definition?
It's a bioconductor extension to rpy2
http://www.bitbucket.org/lgautier/rpy2-bioc-extensions/overview/
I am trying to learn R and at they same time more about python and R
bioconductor packages. So no it is not home
"Vincent Davis" wrote
I am working an a open source project and would like to add feature to a
class.
Current action:
in:>>>b = BString.new('I am a BString object')
That' a very strange idiom in Python.
Can you show us the class definition?
out: >>>b
in:>>>
in:>>>print(b)
out:
Take a look at the repr and str methods:
http://docs.python.org/reference/datamodel.html#basic-customization
Ok so I am still a little confused, It seems that __str__ is used for print
and str()
byt what allows whats below. That is why does just entering the name of the
instance return print(b).
On Mon, Apr 5, 2010 at 12:08 PM, Vincent Davis wrote:
> I am working an a open source project and would like to add feature to a
> class.
> Current action:
> in:>>>b = BString.new('I am a BString object')
> out: >>>b
> in:>>>
> in:>>>print(b)
> out: >>> 21-letter "BString" instance
>
I am working an a open source project and would like to add feature to a
class.
Current action:
in:>>>b = BString.new('I am a BString object')
out: >>>b
in:>>>
in:>>>print(b)
out: >>> 21-letter "BString" instance
seq: I am a BString object
What I would like is to be ab