8000 fix typos and other cosmetic issues (#214) · windreamer/msgpack-python@e3fea94 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit e3fea94

Browse files
ThomasWaldmannmethane
authored andcommitted
fix typos and other cosmetic issues (msgpack#214)
cosmetic issues: - reST headlines' underline length needs to match the headline length (looks like somebody is / was using a proportional font) - Cython code lines do not need to be terminated with a semicolon - always use triple-double-quotes for docstrings
1 parent a9f4dad commit e3fea94

10 files changed

+57
-56
lines changed

ChangeLog.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Changes
160160

161161

162162
0.2.4
163-
=======
163+
=====
164164
:release date: 2012-12-22
165165

166166
Bugs fixed
@@ -169,19 +169,19 @@ Bugs fixed
169169
* Fix SEGV when object_hook or object_pairs_hook raise Exception. (#39)
170170

171171
0.2.3
172-
=======
172+
=====
173173
:release date: 2012-12-11
174174

175175
Changes
176176
-------
177177
* Warn when use_list is not specified. It's default value will be changed in 0.3.
178178

179179
Bugs fixed
180-
-----------
180+
----------
181181
* Can't pack subclass of dict.
182182

183183
0.2.2
184-
=======
184+
=====
185185
:release date: 2012-09-21
186186

187187
Changes
@@ -190,24 +190,24 @@ Changes
190190
object in single precision format.
191191

192192
Bugs fixed
193-
-----------
193+
----------
194194
* ``unpack()`` didn't restores gc state when it called with gc disabled.
195195
``unpack()`` doesn't control gc now instead of restoring gc state collectly.
196196
User can control gc state when gc cause performance issue.
197197

198198
* ``Unpacker``'s ``read_size`` option didn't used.
199199

200200
0.2.1
201-
=======
201+
=====
202202
:release date: 2012-08-20
203203

204204
Changes
205205
-------
206206
* Add ``max_buffer_size`` parameter to Unpacker. It limits internal buffer size
207207
and allows unpack data from untrusted source safely.
208208

209-
* Unpacker's buffer reallocation algorithm is less greedy now. It cause perforamce
210-
derease in rare case but memory efficient and don't allocate than ``max_buffer_size``.
209+
* Unpacker's buffer reallocation algorithm is less greedy now. It cause performance
210+
decrease in rare case but memory efficient and don't allocate than ``max_buffer_size``.
211211

212212
Bugs fixed
213213
----------
@@ -217,7 +217,7 @@ Bugs fixed
217217

218218

219219
0.2.0
220-
=======
220+
=====
221221
:release date: 2012-06-27
222222

223223
Changes
@@ -232,16 +232,16 @@ Bugs fixed
232232

233233

234234
0.1.13
235-
=======
235+
======
236236
:release date: 2012-04-21
237237

238238
New
239-
----
239+
---
240240
* Don't accept subtype of list and tuple as msgpack list. (Steeve Morin)
241241
It allows customize how it serialized with ``default`` argument.
242242

243243
Bugs fixed
244-
-----------
244+
----------
245245
* Fix wrong error message. (David Wolever)
246246
* Fix memory leak while unpacking when ``object_hook`` or ``list_hook`` is used.
247247
(Steeve Morin)
@@ -253,21 +253,21 @@ Other changes
253253

254254

255255
0.1.12
256-
=======
256+
======
257257
:release date: 2011-12-27
258258

259259
Bugs fixed
260-
-------------
260+
----------
261261
262262
* Re-enable packs/unpacks removed at 0.1.11. It will be removed when 0.2 is released.
263263

264264

265265
0.1.11
266-
=======
266+
======
267267
:release date: 2011-12-26
268268

269269
Bugs fixed
270-
-------------
270+
----------
271271

272272
* Include test code for Python3 to sdist. (Johan Bergström)
273273
* Fix compilation error on MSVC. (davidgaleano)
@@ -285,7 +285,7 @@ New feature
285285

286286

287287
0.1.9
288-
======
288+
=====
289289
:release date: 2011-01-29
290290

291291
New feature
@@ -299,16 +299,16 @@ Bugs fixed
299299
* Add MemoryError check.
300300

301301
0.1.8
302-
======
302+
=====
303303
:release date: 2011-01-10
304304

305305
New feature
306-
------------
306+
-----------
307307
* Support ``loads`` and ``dumps`` aliases for API compatibility with
308308
simplejson and pickle.
309309

310310
* Add *object_hook* and *list_hook* option to unpacker. It allows you to
311-
hook unpacing mapping type and array type.
311+
hook unpacking mapping type and array type.
312312

313313
* Add *default* option to packer. It allows you to pack unsupported types.
314314

@@ -320,13 +320,13 @@ Bugs fixed
320320

321321

322322
0.1.7
323-
======
323+
=====
324324
:release date: 2010-11-02
325325

326326
New feature
327-
------------
327+
-----------
328328
* Add *object_hook* and *list_hook* option to unpacker. It allows you to
329-
hook unpacing mapping type and array type.
329+
hook unpacking mapping type and array type.
330330

331331
* Add *default* option to packer. It allows you to pack unsupported types.
332332

README.rst

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
=======================
1+
======================
22
MessagePack for Python
3-
=======================
3+
======================
44

55
:author: INADA Naoki
66
:version: 0.4.6
@@ -11,21 +11,22 @@ MessagePack for Python
1111

1212

1313
What's this
14-
------------
14+
-----------
1515

16-
`MessagePack <http://msgpack.org/>`_ is a fast, compact binary serialization format, suitable for
17-
similar data to JSON. This package provides CPython bindings for reading and
18-
writing MessagePack data.
16+
`MessagePack <http://msgpack.org/>`_ is an efficient binary serialization format.
17+
It lets you exchange data among multiple languages like JSON.
18+
But it's faster and smaller.
19+
This package provides CPython bindings for reading and writing MessagePack data.
1920

2021
Install
21-
---------
22+
-------
2223

2324
::
2425

2526
$ pip install msgpack-python
2627

2728
PyPy
28-
^^^^^
29+
^^^^
2930

3031
msgpack-python provides pure python implementation. PyPy can use this.
3132

@@ -44,7 +45,7 @@ Community Edition or Express Edition can be used to build extension module.
4445

4546

4647
How to use
47-
-----------
48+
----------
4849

4950
One-shot pack & unpack
5051
^^^^^^^^^^^^^^^^^^^^^^
@@ -134,7 +135,7 @@ It is also possible to pack/unpack custom data types. Here is an example for
134135
key-value pairs.
135136

136137
Extended types
137-
^^^^^^^^^^^^^^^
138+
^^^^^^^^^^^^^^
138139

139140
It is also possible to pack/unpack custom data types using the **ext** type.
140141

@@ -166,7 +167,7 @@ Advanced unpacking control
166167

167168
As an alternative to iteration, ``Unpacker`` objects provide ``unpack``,
168169
``skip``, ``read_array_header`` and ``read_map_header`` methods. The former two
169-
read an entire message from the stream, respectively deserialising and returning
170+
read an entire message from the stream, respectively de-serialising and returning
170171
the result, or ignoring it. The latter two methods return the number of elements
171172
in the upcoming container, so that each element in an array, or key-value pair
172173
in a map, can be unpacked or skipped individually.
@@ -243,7 +244,7 @@ instead of `StopIteration`.
243244
`StopIteration` is used for iterator protocol only.
244245

245246
Note about performance
246-
------------------------
247+
----------------------
247248

248249
GC
249250
^^
@@ -253,7 +254,7 @@ This means unpacking may cause useless GC.
253254
You can use ``gc.disable()`` when unpacking large message.
254255

255256
use_list option
256-
^^^^^^^^^^^^^^^^
257+
^^^^^^^^^^^^^^^
257258
List is the default sequence type of Python.
258259
But tuple is lighter than list.
259260
You can use ``use_list=False`` while unpacking when performance is important.
@@ -264,7 +265,7 @@ Another way to unpacking such object is using ``object_pairs_hook``.
264265

265266

266267
Development
267-
------------
268+
-----------
268269

269270
Test
270271
^^^^

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ test_script:
2828
# only needed to support those cases.
2929
# Note that you must use the environment variable %PYTHON% to refer to
3030
# the interpreter you're using - Appveyor does not do anything special
31-
# to put the Python evrsion you want to use on PATH.
31+
# to put the Python version you want to use on PATH.
3232
- "build.cmd %PYTHON%\\python.exe setup.py build_ext -i"
3333
- "build.cmd %PYTHON%\\python.exe setup.py install"
3434
- "%PYTHON%\\python.exe -c \"import sys; print(hex(sys.maxsize))\""

docs/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ API reference
2828
.. autoclass:: ExtType
2929

3030
exceptions
31-
-----------
31+
----------
3232

3333
These exceptions are accessible via `msgpack` package.
3434
(For example, `msgpack.OutOfData` is shortcut for `msgpack.exceptions.OutOfData`)

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
msgpack document
2-
==================
2+
================
33

44
`MessagePack <http://msgpack.org>`_ is a efficient format for inter
55
language data exchange.

msgpack/_packer.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ cdef class Packer(object):
5858
:param bool use_single_float:
5959
Use single precision float type for float. (default: False)
6060
:param bool autoreset:
61-
Reset buffer after each pack and return it's content as `bytes`. (default: True).
61+
Reset buffer after each pack and return its content as `bytes`. (default: True).
6262
If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.
6363
:param bool use_bin_type:
6464
Use bin type introduced in msgpack spec 2.0 for bytes.
65-
It also enable str8 type for unicode.
65+
It also enables str8 type for unicode.
6666
"""
6767
cdef msgpack_packer pk
6868
cdef object _default
@@ -75,7 +75,7 @@ cdef class Packer(object):
7575

7676
def __cinit__(self):
7777
cdef int buf_size = 1024*1024
78-
self.pk.buf = <char*> malloc(buf_size);
78+
self.pk.buf = <char*> malloc(buf_size)
7979
if self.pk.buf == NULL:
8080
raise MemoryError("Unable to allocate internal buffer.")
8181
self.pk.buf_size = buf_size
@@ -108,7 +108,7 @@ cdef class Packer(object):
108108
self.unicode_errors = PyBytes_AsString(self._berrors)
109109

110110
def __dealloc__(self):
111-
free(self.pk.buf);
111+
free(self.pk.buf)
112112

113113
cdef int _pack(self, object o, int nest_limit=DEFAULT_RECURSE_LIMIT) except -1:
114114
cdef long long llval
@@ -274,7 +274,7 @@ cdef class Packer(object):
274274
"""
275275
Pack *pairs* as msgpack map type.
276276
277-
*pairs* should sequence of pair.
277+
*pairs* should be a sequence of pairs.
278278
(`len(pairs)` and `for k, v in pairs:` should be supported.)
279279
"""
280280
cdef int ret = msgpack_pack_map(&self.pk, len(pairs))

msgpack/_unpacker.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ cdef class Unpacker(object):
209209
:param int max_buffer_size:
210210
Limits size of data waiting unpacked. 0 means system's INT_MAX (default).
211211
Raises `BufferFull` exception when it is insufficient.
212-
You shoud set this parameter when unpacking data from untrusted source.
212+
You should set this parameter when unpacking data from untrusted source.
213213
214214
:param int max_str_len:
215215
Limits max length of str. (default: 2**31-1)

msgpack/fallback.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Unpacker(object):
138138
:param int max_buffer_size:
139139
Limits size of data waiting unpacked. 0 means system's INT_MAX (default).
140140
Raises `BufferFull` exception when it is insufficient.
141-
You shoud set this parameter when unpacking data from untrusted source.
141+
You should set this parameter when unpacking data from untrusted source.
142142
143143
:param int max_str_len:
144144
Limits max length of str. (default: 2**31-1)
@@ -188,13 +188,13 @@ def __init__(self, file_like=None, read_size=0, use_list=True,
188188
self.file_like = file_like
189189
self._fb_feeding = False
190190

191-
#: array of bytes feeded.
191+
#: array of bytes fed.
192192
self._fb_buffers = []
193193
#: Which buffer we currently reads
194194
self._fb_buf_i = 0
195195
#: Which position we currently reads
196196
self._fb_buf_o = 0
197-
#: Total size of _fb_bufferes
197+
#: Total size of _fb_buffers
198198
self._fb_buf_n = 0
199199

200200
# When Unpacker is used as an iterable, between the calls to next(),
@@ -203,7 +203,7 @@ def __init__(self, file_like=None, read_size=0, use_list=True,
203203
# the correct moments, we have to keep track of how sloppy we were.
204204
# Furthermore, when the buffer is incomplete (that is: in the case
205205
# we raise an OutOfData) we need to rollback the buffer to the correct
206-
# state, which _fb_slopiness records.
206+
# state, which _fb_sloppiness records.
207207
self._fb_sloppiness = 0
208208

209209
self._max_buffer_size = max_buffer_size or 2**31-1
@@ -303,7 +303,7 @@ def _fb_get_extradata(self):
303303

304304
def _fb_read(self, n, write_bytes=None):
305305
buffs = self._fb_buffers
306-
# We have a redundant codepath for the most common case, such that
306+
# We have a redundant code path for the most common case, such that
307307
# pypy optimizes it properly. This is the case that the read fits
308308
# in the current buffer.
309309
if (write_bytes is None and self._fb_buf_i < len(buffs) and
@@ -598,17 +598,17 @@ class Packer(object):
598598
Convert user type to builtin type that Packer supports.
599599
See also simplejson's document.
600600
:param str encoding:
601-
Convert unicode to bytes with this encoding. (default: 'utf-8')
601+
Convert unicode to bytes with this encoding. (default: 'utf-8')
602602
:param str unicode_errors:
603603
Error handler for encoding unicode. (default: 'strict')
604604
:param bool use_single_float:
605605
Use single precision float type for float. (default: False)
606606
:param bool autoreset:
607-
Reset buffer after each pack and return it's content as `bytes`. (default: True).
607+
Reset buffer after each pack and return its content as `bytes`. (default: True).
608608
If set this to false, use `bytes()` to get content and `.reset()` to clear buffer.
609609
:param bool use_bin_type:
610610
Use bin type introduced in msgpack spec 2.0 for bytes.
611-
It also enable str8 type for unicode.
611+
It also enables str8 type for unicode.
612612
"""
613613
def __init__(self, default=None, encoding='utf-8', unicode_errors='strict',
614614
use_single_float=False, autoreset=True, use_bin_type=False):

0 commit comments

Comments
 (0)
0