Make Python 2.7’s online docs optionally redirect to Python 3 online docs

Rationale: When I use a search engine to google a Python question, I frequently get a link to a page of the Python 2.7 documentation that shows before the Python 3 documentation link. This is annoying and slows down my programming. I propose: That we add a setting to Python’s online documentation that will optionally given that certain conditions are met, we redirect the user to the corresponding Python 3 documentation entry. The conditions: - The Referer header is set to a URL of a major search engine (the Referer is the URL of the last page that whose link was clicked on to reach the documentation) - The user has opted-in to this behavior. (Conceptually this should be user script, but for the collective conscience of all python developers, a doc option would be better. ) I understand that some core devs might just have documentation downloaded and just use that, but a large portion of Python users primarily use online documentation James Lu

On Thu, Mar 7, 2019 at 9:10 AM James Lu <jamtlu@gmail.com> wrote:
There exists browser extensions that do this: https://addons.mozilla.org/en-US/firefox/addon/py3direct/ https://chrome.google.com/webstore/detail/py3redirect/codfjigcljdnlklcaopdci... André Roberge

On Thu, Mar 07, 2019 at 08:10:20AM -0500, James Lu wrote:
Please see https://bugs.python.org/issue35435 and related links from that issue. I've found that the search engines are getting better at linking to the more recent docs. For example, all of these: https://duckduckgo.com/?q=python+docs+random https://search.yahoo.com/yhs/search?p=python+docs+itertools https://www.bing.com/search?q=python+docs+netrc https://www.startpage.com/do/search?q=python+docs+array https://www.dogpile.com/serp?q=python+docs+shutil give me Python 3 first and Python 2 second. Even the comparatively obscure "sndhdr" module gets Python 3 first: https://www.google.com/search?q=python+docs+sndhdr However these gives Python 2 first: https://www.startpage.com/do/search?q=python+docs+netrc https://www.dogpile.com/serp?q=python+docs+fileinput But note that the docs do include a drop down menu to select the version, so it shouldn't be that difficult to swap from old versions to the most recent. (Unless you're looking at *really* old versions like 1.5.) -- Steven

The way search engines works is “the more it’s clicked, the higher it is” In order to have python3 on top of the results, just hit the Python3 result :)

On 3/7/2019 8:56 AM, Steven D'Aprano wrote:
Ditto for me: /3/ before /2/.
I get /2/ before /3/ Even the comparatively
obscure "sndhdr" module gets Python 3 first: https://www.google.com/search?q=python+docs+sndhdr
Ditto, but no /2/ on first page.
However these gives Python 2 first:
/2/ followed by /3.1.5/. No /3/ on first page, so no option to influence better placement of /3/.
I get /3/ before /2/. Does order depend on country? (AU versus US)
-- Terry Jan Reedy

On Thu, Mar 07, 2019 at 05:53:58PM -0500, Terry Reedy wrote:
On 3/7/2019 8:56 AM, Steven D'Aprano wrote:
[...]
[...]
I get /2/ before /3/
Sorry, I forgot to say "Your mileage may vary." Google is well-known for tracking users (even if they aren't logged into a google account at the time) and filtering their search results. As far as I know, only DuckDuckGo promises that all users will see unfiltered results, with everyone seeing the same results from identical searches. So it is quite likely that any other search engine may give different results for identical search terms, according to who you are, whether you are signed into a google account, the country you or your ISP is based in, and the kinds of links you have followed in the past. Not just clicked search links -- Google in particular has an extensive web of tracking bugs throughout the WWW, so they can track you even when you aren't logged in. (Again, YMMV -- those taking active countermeasures may avoid some tracking, and I understand that in the EU Google has legal restrictions on what they collect and what they do with it.) [...]
/2/ followed by /3.1.5/. No /3/ on first page, so no option to influence better placement of /3/.
You could click through to the second page of search results :-) -- Steven

On Fri, Mar 8, 2019 at 10:48 AM Steven D'Aprano <steve@pearwood.info> wrote:
Obligatory XKCD: https://xkcd.com/1334/ It's unclear whether clicking a link on the second page actually trains the search engine, though. Clicks from the first page are (a) easier to track, and (b) more likely to be useful signals from a user, than clicks from subsequent pages are. But then, we have no real information about what DOES train the search engine, so take it all with a grain of salt. ChrisA

Steven D'Aprano wrote:
I've found that the search engines are getting better at linking to the more recent docs.
Likely this is simply due to the fact that Python 3 is being used more than it was, so more of its doc pages are getting linked to. If that's true, then thing should continue to improve over time. -- Greg

On Thu, Mar 7, 2019 at 9:10 AM James Lu <jamtlu@gmail.com> wrote:
There exists browser extensions that do this: https://addons.mozilla.org/en-US/firefox/addon/py3direct/ https://chrome.google.com/webstore/detail/py3redirect/codfjigcljdnlklcaopdci... André Roberge

On Thu, Mar 07, 2019 at 08:10:20AM -0500, James Lu wrote:
Please see https://bugs.python.org/issue35435 and related links from that issue. I've found that the search engines are getting better at linking to the more recent docs. For example, all of these: https://duckduckgo.com/?q=python+docs+random https://search.yahoo.com/yhs/search?p=python+docs+itertools https://www.bing.com/search?q=python+docs+netrc https://www.startpage.com/do/search?q=python+docs+array https://www.dogpile.com/serp?q=python+docs+shutil give me Python 3 first and Python 2 second. Even the comparatively obscure "sndhdr" module gets Python 3 first: https://www.google.com/search?q=python+docs+sndhdr However these gives Python 2 first: https://www.startpage.com/do/search?q=python+docs+netrc https://www.dogpile.com/serp?q=python+docs+fileinput But note that the docs do include a drop down menu to select the version, so it shouldn't be that difficult to swap from old versions to the most recent. (Unless you're looking at *really* old versions like 1.5.) -- Steven

The way search engines works is “the more it’s clicked, the higher it is” In order to have python3 on top of the results, just hit the Python3 result :)

On 3/7/2019 8:56 AM, Steven D'Aprano wrote:
Ditto for me: /3/ before /2/.
I get /2/ before /3/ Even the comparatively
obscure "sndhdr" module gets Python 3 first: https://www.google.com/search?q=python+docs+sndhdr
Ditto, but no /2/ on first page.
However these gives Python 2 first:
/2/ followed by /3.1.5/. No /3/ on first page, so no option to influence better placement of /3/.
I get /3/ before /2/. Does order depend on country? (AU versus US)
-- Terry Jan Reedy

On Thu, Mar 07, 2019 at 05:53:58PM -0500, Terry Reedy wrote:
On 3/7/2019 8:56 AM, Steven D'Aprano wrote:
[...]
[...]
I get /2/ before /3/
Sorry, I forgot to say "Your mileage may vary." Google is well-known for tracking users (even if they aren't logged into a google account at the time) and filtering their search results. As far as I know, only DuckDuckGo promises that all users will see unfiltered results, with everyone seeing the same results from identical searches. So it is quite likely that any other search engine may give different results for identical search terms, according to who you are, whether you are signed into a google account, the country you or your ISP is based in, and the kinds of links you have followed in the past. Not just clicked search links -- Google in particular has an extensive web of tracking bugs throughout the WWW, so they can track you even when you aren't logged in. (Again, YMMV -- those taking active countermeasures may avoid some tracking, and I understand that in the EU Google has legal restrictions on what they collect and what they do with it.) [...]
/2/ followed by /3.1.5/. No /3/ on first page, so no option to influence better placement of /3/.
You could click through to the second page of search results :-) -- Steven

On Fri, Mar 8, 2019 at 10:48 AM Steven D'Aprano <steve@pearwood.info> wrote:
Obligatory XKCD: https://xkcd.com/1334/ It's unclear whether clicking a link on the second page actually trains the search engine, though. Clicks from the first page are (a) easier to track, and (b) more likely to be useful signals from a user, than clicks from subsequent pages are. But then, we have no real information about what DOES train the search engine, so take it all with a grain of salt. ChrisA

Steven D'Aprano wrote:
I've found that the search engines are getting better at linking to the more recent docs.
Likely this is simply due to the fact that Python 3 is being used more than it was, so more of its doc pages are getting linked to. If that's true, then thing should continue to improve over time. -- Greg
participants (7)
-
Adrien Ricocotam
-
Andre Roberge
-
Chris Angelico
-
Greg Ewing
-
James Lu
-
Steven D'Aprano
-
Terry Reedy