5

I am trying to convert this feedparser.py (on github) to python3. I am having trouble understanding what this line is doing, right now it throws a syntax error:

[line 640]   if tag.find(':') <> -1:

what operator is <>. Is there a Python3 equivalent?

3 Answers 3

9

It's a synonym for the inequality operator, !=, as seen in BASIC.

By the way, the line you are asking about would be far more idiomatically written as:

if ":" in tag:
Sign up to request clarification or add additional context in comments.

Comments

7

It's an old spelling of the inequality comparison. Use != instead.

Comments

5

<> is read 'not equals' != will do the same

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.