Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Deprecating Bio.SeqUtils.reverse() function

  • Loading branch information...
commit 0d6a55c9f23a8f8efee28cf6b0a81eaf927681a0 1 parent e2eda00
@peterjc peterjc authored
Showing with 12 additions and 4 deletions.
  1. +9 −4 Bio/SeqUtils/__init__.py
  2. +3 −0  DEPRECATED
View
13 Bio/SeqUtils/__init__.py
@@ -23,13 +23,18 @@
# {{{
def reverse(seq):
- """Reverse the sequence. Works on string sequences.
+ """Reverse the sequence. Works on string sequences (DEPRECATED).
- e.g.
- >>> reverse("ACGGT")
+ This function is now deprecated, instead use the string's built in slice
+ method with a step of minus one:
+
+ >>> "ACGGT"[::-1]
'TGGCA'
-
"""
+ import warnings
+ warnings.warn("Bio.SeqUtils.reverse() is deprecated, use the string's "
+ "slice method with a step of minus one instead.",
+ DeprecationWarning)
r = list(seq)
r.reverse()
return ''.join(r)
View
3  DEPRECATED
@@ -309,6 +309,9 @@ in Release 1.31, and removed in Release 1.43. Function 'translate' was
deprecated in Release 1.49, and removed in Release 1.53. Use the functions
and methods in Bio.Seq instead.
+Function 'reverse' in Bio.SeqUtils was deprecated in Release 1.54, instead
+just use the string's slice method with a step of minus one.
+
Bio.GFF (for accessing a MySQL database created with BioPerl, etc)
=======
The functions 'forward_complement' and 'antiparallel' in Bio.GFF.easy have
Please sign in to comment.
Something went wrong with that request. Please try again.