Giter Club home page Giter Club logo

Comments (6)

kezhenxu94 avatar kezhenxu94 commented on May 31, 2024 1

@cclauss you're right, I tried u'strings' and it works, we are closer to Python 3 now!

from house-renting.

cclauss avatar cclauss commented on May 31, 2024

https://github.com/kezhenxu94/house-renting/blob/master/crawler/house_renting/items.py#L46-L49 and https://github.com/kezhenxu94/house-renting/blob/master/crawler/house_renting/items.py#L65

In Python 3, you can have a u'string' and an r'string' but a ur'string' is a Syntax Error.

flake8 testing of https://github.com/kezhenxu94/house-renting on Python 3.6.3

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./crawler/house_renting/items.py:46:46: E999 SyntaxError: invalid syntax
    minutes_ago = re.compile(ur'.*?(\d+)分钟前.*').search(value)
                                             ^
1     E999 SyntaxError: invalid syntax
1

from house-renting.

cclauss avatar cclauss commented on May 31, 2024

On Python 2, can we try the following?

  1. Convert these ur'strings' to r'strings' and see if the code functions as expected and then
  2. Convert these ur'strings' to u'strings' and see if the code functions as expected

My guess is that one of these will work as expected and the other will not.

from house-renting.

kezhenxu94 avatar kezhenxu94 commented on May 31, 2024

@cclauss now can we say this project is compatible with Python3 and Python2 ?

from house-renting.

cclauss avatar cclauss commented on May 31, 2024

It is syntax compatible with both Python 2 and Python 3. However end users might find bugs that we will need to fix. I think we should say that both Python 2 and Python 3 are now supported. That means that as issues are opened, we will try our best to fix them.

from house-renting.

kezhenxu94 avatar kezhenxu94 commented on May 31, 2024

@cclauss Great. I'll consider closing this issue

from house-renting.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.