install warning

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • python473@yahoo.com

    #1

    install warning

    I downloaded python 2.4. When attempting to run python interpreter, I
    get following:
    warning: strop functions are obsolete; use string methods
    How do I correct this? Did I do install incorrectly?
    Thanks - John

  • jepler@unpythonic.net

    #2
    Re: install warning

    You are importing and using, directly or indirectly, the "strop" module.

    Here's an example from the interactive interpreter which triggers the warning:

    $ python2.3
    Python 2.3.3 (#1, May 7 2004, 10:31:40)
    [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
    Type "help", "copyright" , "credits" or "license" for more information.[color=blue][color=green][color=darkred]
    >>> import strop
    >>> strop.strip(" abc ")[/color][/color][/color]
    __main__:1: DeprecationWarn ing: strop functions are obsolete; use string methods
    'abc'

    Most of the things in strop are now simply methods on string objects:[color=blue][color=green][color=darkred]
    >>> " abc ".strip()[/color][/color][/color]
    'abc'

    Another way to prevent the warning from being printed is through use of the
    'warnings' module, which is documented on docs.python.org .

    Jeff

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (GNU/Linux)

    iD8DBQFDaYZEJd0 1MZaTXX0RAmnJAJ 4ywPCylqqw81+kA AddmqQtbROEAQCg jV2G
    01L7j6vSpW72Nky 75QGHNkc=
    =TSy8
    -----END PGP SIGNATURE-----

    Comment

    Working...