[issue28798] Describe character as a string of length one instead of size one in tutorial

2016-11-24 Thread Liang-Bo Wang

New submission from Liang-Bo Wang:

In Tutorial "An Informal Introduction" section, character is introduced as a 
string of size one. It may be true for python 2.x, where str can be interpreted 
as bytes. However in Python 3, strings are unicode thus the size and the length 
of a string are usually not the same. Also, using size of a string can be 
confused with the result returned by sys.getsizeof(mystr), where 
sys.getsizeof('a') != 1. 

Therefore using "a string of length one" to describe a character may be less 
confusing. The patch attached changes the wording.

--
assignee: docs@python
components: Documentation
files: docs_tutorial_introduction_str.diff
keywords: patch
messages: 281678
nosy: ccwang002, docs@python
priority: normal
severity: normal
status: open
title: Describe character as a string of length one instead of size one in 
tutorial
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45634/docs_tutorial_introduction_str.diff

___
Python tracker 
<http://bugs.python.org/issue28798>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-01-31 Thread Liang Bo Wang

New submission from Liang Bo Wang:

The code output toggle button (the `>>>` button on the top right) has been 
disappeared and not functional on the current online documentation (both 3.4+ 
and 2.7). 


For example, see any doc page that has interpreter outputs:

https://docs.python.org/3/tutorial/introduction.html#numbers
https://docs.python.org/3.5/tutorial/introduction.html#numbers
https://docs.python.org/3.4/tutorial/introduction.html#numbers
https://docs.python.org/2/tutorial/introduction.html#numbers


These toggle buttons are created dynamically using jQuery by the script at 
Doc/tools/static/copybutton.js. However, the method .toggle() it used for click 
event handling has been deprecated since jQuery 1.8 and removed since jQuery 
1.9.

https://api.jquery.com/toggle-event/


Current Python documentation ships with jQuery v1.11.1 and it has a new 
.toggle() method with totally different behavior, which controls animation and 
hide the element. Therefore those buttons are invisible and has no effect.

https://api.jquery.com/toggle/


To achieve the old behavior, one now needs to create this toggle event on one's 
own. The most popular way to store the toggle state is by jQuery's .data() data 
storage.

A patch is attached to make the button functional again.

--
assignee: docs@python
components: Documentation
files: copybutton_js.patch
keywords: patch
messages: 259279
nosy: Liang Bo Wang, docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: Code output toggle button uses removed jQuery method
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41764/copybutton_js.patch

___
Python tracker 
<http://bugs.python.org/issue26246>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Liang-Bo Wang

Liang-Bo Wang added the comment:

Just FYI, I applied the patch to the zh-hant translation of the documentation 
and the code output toggle button is back and works as expected.

https://docs.python.org.tw/3/tutorial/introduction.html#numbers

You can see the result of any other page by changing the URL domain from 
docs.python.org to docs.python.org.tw

--

___
Python tracker 
<http://bugs.python.org/issue26246>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26246] Code output toggle button uses removed jQuery method

2016-02-26 Thread Liang-Bo Wang

Liang-Bo Wang added the comment:

Thanks for the merge. 

I pulled the change and checked the result, but I found the patch missing a 
line to initiate the correct display state when the button was created. That 
is, it forgot to set `button.data('hidden', 'false');` when adding the button. 

This causes the first click on the button to have no effect. But the following 
clicks will work.

I filed the new patch to add this line back. I'm so sorry I missed this line :(

--
Added file: http://bugs.python.org/file42036/copybutton_js_2.patch

___
Python tracker 
<http://bugs.python.org/issue26246>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com