OpenGenus / cosmos

World's largest Contributor driven code dataset | Used in Quark Search Engine, @OpenGenus IQ, OpenGenus Visual Project
http://internship.opengenus.org
GNU General Public License v3.0
13.58k stars 3.69k forks source link

old codes are not supported in python 3 #3402

Open tbhaxor opened 6 years ago

tbhaxor commented 6 years ago

This is a(n):

Details:

Python 2 will be obsoleted in ~2 years. Some of your use python 2 functions like

  1. print
  2. xrange
  3. raw_input

Changes to be made

  1. import print from future

    from __future__ import print_function
  2. change xrange to range

    try:
    xrange = range
    except NameError:
    pass
  3. change raw_input to range

    try:
    input = raw_input
    except NameError:
    pass
arnavb commented 6 years ago

I think a better change might be to just convert the code? But yes, a good early change would be to add snippets such as this. However, this should be replaced with pure python3 code in the future.

tbhaxor commented 6 years ago

may i take the responsibility, after march ?

arnavb commented 6 years ago

@tbhaxor By all means, go for it! :+1:

tbhaxor commented 6 years ago

i believe in updating all code to py3

what do you think @AdiChat and @arnavb ?

mansiag commented 6 years ago

I would like to work on this.

arnavb commented 6 years ago

@mansiag @tbhaxor Sure, like I said, go for it! Python 2 is getting old...

tbhaxor commented 6 years ago

@mansiag lemme take this :D I have committed changes only 2 3 directories are left

arnavb commented 6 years ago

@tbhaxor You've gone through nearly every single Python 2 file?

Wow... 👏 👏

tbhaxor commented 6 years ago

@arnavb never doubt on my dedication :laughing:

tbhaxor commented 6 years ago

@mansiag please allow me to open other Pull Request

mansiag commented 6 years ago

@tbhaxor Can I work on this segment or should I delete this PR? I wont make any other changes. Thanks:smile:

tbhaxor commented 6 years ago

@mansiag review all code in code/data_structures :smile:

mansiag commented 6 years ago

@tbhaxor Thanks:smile: