Skip to content

Commit

Permalink
Trac #24570: py3: using the new tags py3 and py2 in some rst files
Browse files Browse the repository at this point in the history
replacing the former "optional - py2" used there.

URL: https://trac.sagemath.org/24570
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Jeroen Demeyer
  • Loading branch information
Release Manager authored and vbraun committed Jan 27, 2018
2 parents d6c9aed + 1aa0545 commit 9396336
Show file tree
Hide file tree
Showing 17 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/doc/de/tutorial/afterword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ sein, also verhält sich Sage an manchen Stellen anders als Python.
Rational Field
sage: 2//3
0
sage: int(2)/int(3) # optional - python2
sage: int(2)/int(3) # py2
0

- **Große ganze Zahlen:** Python besitzt von Hause aus Unterstützung
Expand Down
4 changes: 2 additions & 2 deletions src/doc/de/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ verwendet haben, eine Liste (python 2):

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

Hier ist eine etwas kompliziertere Liste:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/en/tutorial/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ the Python int ``1`` is unique, but the Sage Integer ``1`` is not:

sage: 1 is 2/2
False
sage: int(1) is int(2)/int(2) # optional - python2
sage: int(1) is int(2)/int(2) # py2
True
sage: 1 is 1
False
Expand Down
4 changes: 2 additions & 2 deletions src/doc/en/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ the ``range`` command that we used creates a list (in python 2):

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

Here is a more complicated list:
Expand Down
4 changes: 2 additions & 2 deletions src/doc/es/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ Por ejemplo, el comando ``range`` que hemos usado crea una lista (python 2):

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

He aquí una lista más complicada:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/fr/tutorial/afterword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Aussi, Sage se comporte différemment de Python à plusieurs égards.
Rational Field
sage: 2//3
0
sage: int(2)/int(3) # optional - python2
sage: int(2)/int(3) # py2
0

- **Entiers longs :** Python possède nativement un support pour les entiers de
Expand Down
4 changes: 2 additions & 2 deletions src/doc/fr/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ liste (en python 2):

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

Voici un exemple plus compliqué de liste :
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/afterword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Pythonの数学機能には混乱を招きがちな面があり,SageにはPyth
Rational Field
sage: 2//3
0
sage: int(2)/int(3) # optional - python2
sage: int(2)/int(3) # py2
0

- **長整数:** Python本体は,C言語由来のint型だけではなく任意精度整数をサポートしている.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ja/tutorial/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ Sageにおける異種オブジェクト間の比較演算では,まず対象

sage: 1 is 2/2
False
sage: int(1) is int(2)/int(2) # optional - python2
sage: int(1) is int(2)/int(2) # py2
True
sage: 1 is 1
False
Expand Down
4 changes: 2 additions & 2 deletions src/doc/ja/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ Sageにおける最も基本的なデータ構造はリストで,名前の示

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

もう少し複雑なリストの例として:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/afterword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ se comporta diferentemente do Python em diversas situações.
Rational Field
sage: 2//3
0
sage: int(2)/int(3) # optional - python2
sage: int(2)/int(3) # py2
0

- **Inteiros longos:** O Python possui suporte nativo para inteiros
Expand Down
2 changes: 1 addition & 1 deletion src/doc/pt/tutorial/programming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ o int ``1`` do Python é único, mas o Inteiro ``1`` do Sage não é.

sage: 1 is 2/2
False
sage: int(1) is int(2)/int(2) # optional - python2
sage: int(1) is int(2)/int(2) # py2
True
sage: 1 is 1
False
Expand Down
4 changes: 2 additions & 2 deletions src/doc/pt/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ exemplo, o comando ``range`` que usamos acima cria uma lista:

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

Abaixo segue uma lista mais complicada:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/ru/tutorial/afterword.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Sage ведет себя немного другим образом.
Rational Field
sage: 2//3
0
sage: int(2)/int(3) # optional - python2
sage: int(2)/int(3) # py2
0

- **Большие целые числа:** Python имеет встроенную поддержку целых чисел
Expand Down
4 changes: 2 additions & 2 deletions src/doc/ru/tutorial/tour_help.rst
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ tanh, taylor``. Данная функция является хорошим сп

::

sage: range(2,10) # optional - python2
sage: range(2,10) # py2
[2, 3, 4, 5, 6, 7, 8, 9]
sage: list(range(2,10)) # optional - python3
sage: list(range(2,10)) # py3
[2, 3, 4, 5, 6, 7, 8, 9]

Далее показан пример более сложного списка:
Expand Down
2 changes: 1 addition & 1 deletion src/sage/misc/sageinspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ def visit_BinOp(self, node):
sage: import ast, sage.misc.sageinspect as sms
sage: visitor = sms.SageArgSpecVisitor()
sage: vis = lambda x: visitor.visit(ast.parse(x).body[0].value)
sage: [vis(d) for d in ['(3+(2*4))', '7|8', '5^3', '7/3', '7//3', '3<<4']] #indirect doctest # optional - python2
sage: [vis(d) for d in ['(3+(2*4))', '7|8', '5^3', '7/3', '7//3', '3<<4']] #indirect doctest # py2
[11, 15, 6, 2, 2, 48]
"""
op = node.op.__class__.__name__
Expand Down
4 changes: 2 additions & 2 deletions src/sage/repl/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ def load(filename, globals, attach=False):
sage: t = tmp_filename(ext='.py')
sage: _ = open(t,'w').write("print 'hi', 2/3; z = -2/7")
sage: z = 1
sage: sage.repl.load.load(t, globals()) # optional - python2
sage: sage.repl.load.load(t, globals()) # py2
hi 0
sage: z # optional - python2
sage: z # py2
-1
A ``.sage`` file *is* preparsed::
Expand Down

0 comments on commit 9396336

Please sign in to comment.