[pypy-commit] pypy rpython-sprint: Spellchecking and cleanup.
ariava
pypy.commits at gmail.com
Mon Mar 19 05:00:22 EDT 2018
Author: Arianna Avanzini <avanzini.arianna at gmail.com>
Branch: rpython-sprint
Changeset: r93997:5f1376bbe863
Date: 2018-03-18 19:09 +0100
http://bitbucket.org/pypy/pypy/changeset/5f1376bbe863/
Log: Spellchecking and cleanup.
- Fix spellchecking nits in few comments and in translation.rst
- Fix TypeError message in rpython/annotator/signature.py
diff --git a/rpython/annotator/signature.py b/rpython/annotator/signature.py
--- a/rpython/annotator/signature.py
+++ b/rpython/annotator/signature.py
@@ -103,7 +103,7 @@
elif bookkeeper and not hasattr(t, '_freeze_'):
return SomeInstance(bookkeeper.getuniqueclassdef(t))
else:
- raise AssertionError("annotationoftype(%r)" % (t,))
+ raise TypeError("Annotation of type %r not supported" % (t,))
class Sig(object):
diff --git a/rpython/doc/translation.rst b/rpython/doc/translation.rst
--- a/rpython/doc/translation.rst
+++ b/rpython/doc/translation.rst
@@ -48,7 +48,7 @@
be present in memory as a form that is "static enough" in the sense of
:doc:`RPython <rpython>`.
-2. The Annotator_ performs a global analysis starting from an specified
+2. The Annotator_ performs a global analysis starting from a specified
entry point to deduce type and other information about what each
variable can contain at run-time, :ref:`building flow graphs <flow-graphs>`
as it encounters them.
diff --git a/rpython/rlib/objectmodel.py b/rpython/rlib/objectmodel.py
--- a/rpython/rlib/objectmodel.py
+++ b/rpython/rlib/objectmodel.py
@@ -120,7 +120,7 @@
""" Decorate a function with forcing of RPython-level types on arguments.
None means no enforcing.
- When not translated, the type of the actual arguments are checked against
+ When not translated, the type of the actual arguments is checked against
the enforced types every time the function is called. You can disable the
typechecking by passing ``typecheck=False`` to @enforceargs.
"""
@@ -147,8 +147,7 @@
# they are already homogeneous, so we only check the first
# item. The case of empty list/dict is handled inside typecheck()
if isinstance(arg, list):
- item = arg[0]
- return [get_type_descr_of_argument(item)]
+ return [get_type_descr_of_argument(arg[0])]
elif isinstance(arg, dict):
key, value = next(arg.iteritems())
return {get_type_descr_of_argument(key): get_type_descr_of_argument(value)}
More information about the pypy-commit
mailing list