[issue10579] Is ``o[key]`` equivalent to PyMapping_HasKeyString?

2010-11-29 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/c-api/mapping.html#PyMapping_HasKeyString and http://docs.python.org/c-api/mapping.html#PyMapping_HasKey says: This is equivalent to ``o[key]`` I think it should be ``key in o``. -- assignee: d...@python

[issue10579] Is ``o[key]`` equivalent to PyMapping_HasKeyString?

2010-11-29 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: I'm sorry, I've misreaded. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10579

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/c-api/list.html#PyList_New Note: If length is greater than zero, ... s/length/len/ -- assignee: d...@python components: Documentation messages: 122974 nosy: d...@python, naoki priority: normal severity

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: http://docs.python.org/c-api/list.html#PyList_GetItem Return the object at position pos in the list pointed to by p s/p/list/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: http://docs.python.org/c-api/list.html#PyList_GetItem Return the object at position pos in the list pointed to by p s/pos/index/ -- ___ Python tracker rep...@bugs.python.org http

[issue10594] Typo in PyList_New doc.

2010-11-30 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: OK, please. On Wed, Dec 1, 2010 at 12:46 PM, Eli Bendersky rep...@bugs.python.org wrote: Eli Bendersky eli...@gmail.com added the comment: Thanks for the report, Attaching a patch for Doc/c-api/list.rst in Python 3.2 If this is OK, I

[issue10597] Py_SetPythonHome document shows same url twice.

2010-12-01 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/c-api/init.html#Py_SetPythonHome The libraries are searched in home/lib/pythonversion and home/lib/pythonversion. Is the second {home}/lib/python{version} wrong? -- assignee: d...@python components

[issue10607] Document of PyOS_(v)snprintf is wrong.

2010-12-02 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/c-api/conversion.html#PyOS_vsnprintf the buffer size needed to avoid truncation exceeds size by more than 512 bytes, Python aborts with a Py_FatalError. I think :cfunc:`vsprintf`'s output exeeds the buffer need

[issue10607] Document of PyOS_(v)snprintf is wrong.

2010-12-02 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: Sorry, I've misreaded the sentence. -- resolution: - invalid status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10607

[issue8707] Duplicated document in telnetlib.

2010-05-13 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/dev/library/telnetlib.html#telnetlib.Telnet The part number can be passed to the constructor... is duplicated. -- assignee: d...@python components: Documentation messages: 105667 nosy: d...@python, naoki

[issue8724] bind_and_activate parameter is missed from directive

2010-05-15 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/dev/library/simplexmlrpcserver.html#SimpleXMLRPCServer.SimpleXMLRPCServer bind_and_activate parameter is described but not defined in directive. -- messages: 105803 nosy: naoki priority: normal severity

[issue8724] bind_and_activate parameter is missed from directive

2010-05-15 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- assignee: - d...@python components: +Documentation nosy: +d...@python versions: +Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8724

[issue8744] Maybe typo in doc

2010-05-17 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/dev/library/test.html#test.test_support.captured_stdout This is a context manager than runs the with statement body using a StringIO.StringIO object as sys.stdout. I think than is typo of that. -- assignee

[issue8875] XML-RPC improvement is described twice.

2010-06-01 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/dev/whatsnew/2.7.html#new-and-improved-modules The XML-RPC client and server, provided by... appears twice. -- assignee: d...@python components: Documentation messages: 106875 nosy: d...@python, naoki

[issue7768] raw_input should encode unicode prompt with std.stdout.encoding.

2010-06-08 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: I agree to close this bug without fix. I hope that Python3 will be mainstream soon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7768

[issue7768] raw_input should encode unicode prompt with std.stdout.encoding.

2010-06-08 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: What do you mean by mainstream? Python3 is available in Ubuntu (since Karmic), Fedora 13, Mandriva 2010.0, Gentoo, Debian (only Sid for now), ... It means most of Pythonista uses Python3 rather than Python2 and most of libraries supports

[issue5911] built-in compile() should take encoding option.

2010-08-24 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: This problem is not heavy on Python 3. Because Python 3's byte string can't contain non-ASCII string directory. So passing unicode string to the compile() is good enough for all cases I can imagine

[issue10410] Is iterable a container type?

2010-11-13 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: In http://docs.python.org/release/2.6.6/glossary.html, iterable is described as A container object capable of returning its members one at a time. Is it correct? Is stream object like file a container type? Container ABC requires only

[issue10410] Is iterable a container type?

2010-11-14 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: Likewise, and objects of any classes you define with an __iter__() or __getitem__() method. is wrong because __getitem__ method is not relate to iterable That wording is correct.  Sequences are automatically iterable even if they don't

[issue10420] Document of Bdb.effective is wrong.

2010-11-14 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/library/bdb.html#bdb.effective Determine if there is an effective (active) breakpoint at this line of code. Return breakpoint number or 0 if none. bdb.effective doesn't return 0. If no breakpoint is found

[issue7869] traceback from logging is unusable.

2010-02-06 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: When exception raised in logging, traceback is shown but it doesn't tell me which logging code cause the error. $ cat unusable_traceback.py import logging logging.warn('%s %s', 1) # not enough arguments. $ python unusable_traceback.py

[issue7869] traceback from logging is unusable.

2010-02-06 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: This patch shows filename and lineno. I can specify my wrong logging code with this patch. -- keywords: +patch Added file: http://bugs.python.org/file16164/logging_show_file_and_line.patch

[issue8280] urllib2 passes fragment identifier to server

2010-04-01 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: urllib2.urlopen(http://wave-robot-python-client.googlecode.com/svn/trunk/pydocs/index.html#module-wavelet;) Traceback (most recent call last): File stdin, line 1, in module File C:\usr\Python2.6\lib\urllib2.py, line 126, in urlopen

[issue8280] urllib2 passes fragment identifier to server

2010-04-01 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- components: +Library (Lib) type: - behavior versions: +Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue8686] This isn't defined beyond that phrase is not friendly to non-native English speakers.

2010-05-11 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/library/difflib.html#difflib.SequenceMatcher.quick_ratio This isn’t defined beyond that it is an upper bound on ratio(), and is faster to compute. beyond is a bit confusing because it also means over

[issue11405] Wrong reference to string module in tutorial/inputoutput.rst

2011-03-04 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/py3k/tutorial/inputoutput.html#fancier-output-formatting The standard module string contains some useful operations for padding strings to a given column width; these will be discussed shortly. The document uses

[issue11418] Method's global scope is module containing function definition, not class.

2011-03-06 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/py3k/tutorial/classes.html#random-remarks Methods may reference global names in the same way as ordinary functions. The global scope associated with a method is the module containing the class definition

[issue11418] Method's global scope is module containing function definition, not class.

2011-03-06 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- assignee: - docs@python components: +Documentation nosy: +docs@python versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http

[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: * Insert spaces around operators and after commas. * Split one liner blocks (ex. def foo(x, y): return x + y) to multi-line blocks. * Insert empty line after def block for scripts (not interactive mode). * Use new-style raise (s/ralse

[issue11425] Cleanup sample codes in tutorial.

2011-03-06 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: This patch inserts spaces around ** operator but I prefer no spaces around **. Any thoughts? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11425

[issue13367] PyCapsule_New's argument *must* not a NULL.

2011-11-07 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/c-api/capsule.html?highlight=capsule#PyCapsule_New The pointer argument may not be NULL. I think must not is correct. -- assignee: docs@python components: Documentation messages: 147269 nosy: docs@python

[issue13467] Typo in doc for library/sysconfig

2011-11-23 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: http://docs.python.org/library/sysconfig.html#sysconfig.get_path If scheme is provided, it must be a value from the list returned by get_path_names(). s/get_path_names/get_scheme_names/ -- assignee: docs@python components

[issue13663] pootle.python.org is outdated.

2011-12-26 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: I am one of Japanese translate of Python documents. We have done translating Python 2.7 document and will start translating Python 3.2 or 3.3. I want to use sphinx-i18n and pootle to translate. But http://pootle.python.org/ is very

[issue13663] pootle.python.org is outdated.

2011-12-31 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: On Sat, Dec 31, 2011 at 11:31 PM, Martin v. Löwis rep...@bugs.python.org wrote: Martin v. Löwis mar...@v.loewis.de added the comment: naoki: what is your actual complaint about the installation being outdated? Are you referring

[issue11418] Method's global scope is module containing function definition, not class.

2012-01-09 Thread INADA Naoki
INADA Naoki songofaca...@gmail.com added the comment: Any objections to changing The global scope associated with a method is the module containing the class definition. (The class itself is never used as a global scope.) to The global scope associated with a method is the module

[issue16711] s/next()/__next__/ in collections.abc.Iterator document.

2012-12-18 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator ABC for classes that provide the __iter__() and next() methods. next() should be __next__() for Python 3. -- assignee: docs@python components: Documentation messages

[issue16712] collections.abc.Sequence should not provide __reversed__

2012-12-18 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/reference/datamodel.html#object.__reversed__ Objects that support the sequence protocol should only provide __reversed__() if they can provide an implementation that is more efficient than the one provided by reversed

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/glossary.html#term-sequence __getitem__ and __len__ are required for sequence type. (__iter__ is not required because types having __getitem__ are already iterator.) .__contains__(), .index() and .count() is not required for sequence

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
INADA Naoki added the comment: In Python 3.3: In [33]: issubclass(Foo, collections.abc.Sequence) Out[33]: False -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16728

[issue16728] collections.abc.Sequence shoud provide __subclasshook__

2012-12-19 Thread INADA Naoki
INADA Naoki added the comment: I think PySequence_Check() has same problem. OTOH, mapping definition says: A container object that supports arbitrary key lookups and implements the methods specified in the Mapping or MutableMapping abstract base classes. - http://docs.python.org/3.3

[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki
INADA Naoki added the comment: Thanks, Nick. I see that the sequence doesn't have strict definition. Though, I think collections.abc module's document should describe this manner. For example: But checking type with these abc may be too strict for most case. For example, some user defined

[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki
INADA Naoki added the comment: So, I feel the 2nd meaning of sequence should be collections.abc.(Mutable)Sequence. sequence types in stdlib have richer API then the ABC. (e.g. comparison, +, *, etc...) They are APIs that sequence may have but not APIs makes the type sequence

[issue16728] Missing cross-reference in sequence glossary entry

2012-12-21 Thread INADA Naoki
INADA Naoki added the comment: And nice symmetry with mapping entry. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16728 ___ ___ Python-bugs

[issue16712] collections.abc.Sequence should not provide __reversed__

2012-12-21 Thread INADA Naoki
INADA Naoki added the comment: I believe that using Sequence ABC as mix-in is recommended when implementing custom sequence. But mixing-in it violates should only provide __reversed__() if they can provide an implementation that is more efficient than the one provided by reversed

[issue16712] collections.abc.Sequence should not provide __reversed__

2012-12-25 Thread INADA Naoki
INADA Naoki added the comment: __contains__ is required for Container. So there is a clear reason to define it. Additionaly, http://docs.python.org/3.3/reference/datamodel.html#object.__contains__ doesn't discourage to implement slower pure-python method. In case of __reversed__, I can't find

[issue12822] NewGIL should use CLOCK_MONOTONIC if possible.

2011-08-23 Thread INADA Naoki
New submission from INADA Naoki songofaca...@gmail.com: Using CLOCK_MONOTONIC is better than CLOCK_REALTIME (default) for GIL because settimeofday() may break the pthread_cond_timedwait(). Attached patch uses CLOCK_MONOTONIC and clock_gettime. But I don't know how to write appropriate configure

[issue15216] Support setting the encoding on a text stream after creation

2012-08-06 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- nosy: +naoki ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15216 ___ ___ Python-bugs-list

[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2013-04-04 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- nosy: +naoki ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17636 ___ ___ Python-bugs-list

[issue20134] typo: s/coping/copying/

2014-01-05 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/unittest.mock-examples.html#coping-with-mutable-arguments coping should be copying? -- assignee: docs@python components: Documentation messages: 207409 nosy: docs@python, naoki priority: normal severity: normal status

[issue20222] unittest.mock-examples doc uses builtin file which is removed in Python 3

2014-01-11 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/unittest.mock-examples.html#mocking-chained-calls Let’s assume the object it returns is ‘file-like’, so we’ll ensure that our response object uses the builtin file as its spec. and mock_response = Mock(spec=file

[issue20236] Invalid inline markup in xml document.

2014-01-12 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/xml.html#xml-vulnerabilities DTD retrieval Some XML libraries like Python’s mod:’xml.dom.pulldom’ retrieve document mod: should be :mod: -- assignee: docs@python components: Documentation messages: 208012 nosy

[issue20237] Ambiguous sentence in document of xml package.

2014-01-13 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/xml.html#defused-packages The courses of action are recommended for any server code that parses untrusted XML data. What this sentence means? What The courses is? -- assignee: docs@python components: Documentation

[issue20241] Bad reference to RFC in document of ipaddress?

2014-01-13 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/ipaddress.html#ipaddress.IPv4Address.is_unspecified True if the address is unspecified. See RFC 5375 (for IPv4) or RFC 2373 (for IPv6). RFC 5375 is IPv6 Unicast Address Assignment Considerations. -- assignee

[issue20241] Bad reference to RFC in document of ipaddress?

2014-01-13 Thread INADA Naoki
INADA Naoki added the comment: Is it 5735 ? Next sentence may be wrong, too. True if the address is otherwise IETF reserved. Is it True if the address is IETF reserved. ? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue20253] Typo in ipaddress document

2014-01-13 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/ipaddress.html#ipaddress.IPv4Network.broadcast_address Wrong attribute name: s/host mask/hostmask/ -- assignee: docs@python components: Documentation messages: 208078 nosy: docs@python, naoki priority: normal severity

[issue20487] Odd words in unittest.mock document.

2014-02-02 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/unittest.mock.html#magic-mock The two equality method, __eq__ and __ne__, are special. They do the default equality comparison on identity, using a side effect, unless you change their return value to return something else

[issue20497] Unclear word in socket document.

2014-02-02 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3.3/library/socket.html#socket.getaddrinfo Changed in version 3.2: parameters can now be passed as single keyword arguments. What *single* means? I can use multiple keyword arguments: In [3]: socket.getaddrinfo('www.python.org', 80

[issue20837] Ambiguity words in base64 documentation

2014-03-02 Thread INADA Naoki
New submission from INADA Naoki: http://docs.python.org/3/library/base64.html The modern interface supports encoding and decoding ASCII byte string objects using all three alphabets. What all three alphabets means? I think it is about *altchars*. But the sentence is too ambiguous

[issue20837] Ambiguity words in base64 documentation

2014-03-02 Thread INADA Naoki
INADA Naoki added the comment: Here's patch. -- keywords: +patch Added file: http://bugs.python.org/file34272/base64.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20837

[issue21074] Too aggressive constant folding

2014-03-26 Thread INADA Naoki
New submission from INADA Naoki: When I run following script: def uncalled(): x = b'x' * (2**32) print('Hello') Python 3.4 consumes huge memory in spite of uncalled() function isn't called. $ /usr/bin/time -l /usr/local/bin/python2 constant_folding.py Hello 0.02 real 0.01

[issue21074] Too aggressive constant folding

2014-03-28 Thread INADA Naoki
INADA Naoki added the comment: For example. I want to write test like this: @unittest.skip(This test requires huge memory) def test_largebuf(): client = self.create_client() data = b'x' * (2**32 - 1) client.send(data) -- ___ Python

[issue21146] update gzip usage examples in docs

2014-04-03 Thread INADA Naoki
INADA Naoki added the comment: Maybe, shutil.copyfileobj() is good. import gzip import shutil with open(src, 'rb') as f_in: with gzip.open(dst, 'wb') as f_out: shutil.copyfileobj(f_in, f_out) -- nosy: +naoki ___ Python tracker rep

[issue10614] ZipFile: add a filename_encoding argument

2014-04-20 Thread INADA Naoki
Changes by INADA Naoki songofaca...@gmail.com: -- nosy: +naoki ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10614 ___ ___ Python-bugs-list

[issue19870] Backport Cookie fix to 2.7 (httponly / secure flag)

2014-06-19 Thread INADA Naoki
INADA Naoki added the comment: Could someone review this? While this is not a regression or bug, I think this is an important feature when writing HTTP clients. -- nosy: +naoki ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-04 Thread INADA Naoki
New submission from INADA Naoki: In [1]: import datetime In [2]: datetime.datetime.utcfromtimestamp(0) Out[2]: datetime.datetime(1970, 1, 1, 0, 0) In [3]: datetime.datetime.utcfromtimestamp(0).replace(tzinfo=datetime.timezone.utc) Out[3]: datetime.datetime(1970, 1, 1, 0, 0, tzinfo

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-04 Thread INADA Naoki
INADA Naoki added the comment: This is not a spelling issue. When people writing code converting between unixtime and datetime, they should find `.timestamp()` and `.utcfromtimestamp()`. But they may not awake about `.replace(tzinfo=datetime.timezone.utc)` is very important. Since

[issue22791] datetime.utcfromtimestamp() shoud have option for create tz aware datetime

2014-11-08 Thread INADA Naoki
INADA Naoki added the comment: akira: It seems cleaner than utcfromtimestamp().replace(). I think utcfromtimestamp() should have note about it. Note that it returns **naive** (tz=None) datetime. Naive datetime is treated as localtime in most functions. If you want to create aware datetime

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-10 Thread INADA Naoki
INADA Naoki added the comment: I've updated patch to use PyUnicode_MAX_CHAR_VALUE(). -- Added file: http://bugs.python.org/file37669/json-fast-unicode-encode.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23206

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-10 Thread INADA Naoki
INADA Naoki added the comment: test_encode_basestring_ascii.py has duplicated test cases. -- Added file: http://bugs.python.org/file37670/json-fast-unicode-encode.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23206

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
INADA Naoki added the comment: Patch update. Now C version does escaping same way to Python version. -- Added file: http://bugs.python.org/file37656/json-fast-unicode-encode.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
New submission from INADA Naoki: I prefer ensure_ascii=False because it's efficient. But I notice it is very slower. On Python 3.4.2: In [3]: %timeit json.dumps([{'hello': 'world'}]*100) 1 loops, best of 3: 74.8 µs per loop In [4]: %timeit json.dumps([{'hello': 'world'}]*100, ensure_ascii

[issue23206] json.dumps(ensure_ascii=False) is ~10x slower than json.dumps()

2015-01-09 Thread INADA Naoki
INADA Naoki added the comment: I've copied test_encode_basestring_ascii.py and modify it for this patch. -- Added file: http://bugs.python.org/file37654/test_encode_basestring.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-08-19 Thread INADA Naoki
INADA Naoki added the comment: Why are bytes being escaped in a binary blob? The reason to use surrogateescape is when you have data that is mostly text, should be processed as text, but can have occasional binary data. That wouldn't seem to apply to a database binary blob. Since SQL

[issue24870] Optimize coding with surrogateescape and surrogatepass error handlers

2015-08-17 Thread INADA Naoki
INADA Naoki added the comment: I've stripped Serhiy's patch for ascii. Here is benchmark result: https://gist.github.com/methane/2376ac5d20642c05a8b6#file-result-md Is there chance for applying this patch to 3.5.1? -- Added file: http://bugs.python.org/file40195/faster-decode-ascii

[issue24870] surrogateescape is too slow

2015-08-14 Thread INADA Naoki
New submission from INADA Naoki: surrogateescape is recommended way to mix binary data in string protocol. But surrogateescape is too slow and it cause usability problem. One actual problem is: https://github.com/PyMySQL/PyMySQL/issues/366 surrogateescape is slow because errorhandler is called

[issue24870] surrogateescape is too slow

2015-08-14 Thread INADA Naoki
INADA Naoki added the comment: On MacBook Pro (Core i5 2.6GHz), surrogateescape 1MB data takes 250ms. In [1]: bs = bytes(range(256)) * (4 * 1024) In [2]: len(bs) Out[2]: 1048576 In [3]: %timeit x = bs.decode('ascii', 'surrogateescape') 1 loops, best of 3: 249 ms per loop

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2015-10-10 Thread INADA Naoki
INADA Naoki added the comment: UTF-8 and Latin1 are typical encoding for MySQL query. When inserting BLOB: # Decode binary data x = data.decode('ascii', 'surrogateescape') # %-format query psql = sql % (escape(x),) # sql is unicode # Encode sql to connection encoding (latin1 or utf8

[issue24870] Optimize ascii and latin1 decoder with surrogateescape and surrogatepass error handlers

2016-01-07 Thread INADA Naoki
INADA Naoki added the comment: FYI, I found a workaround. https://github.com/PyMySQL/PyMySQL/pull/409 _table = [chr(i) for i in range(128)] + [chr(i) for i in range(0xdc80, 0xdd00)] def decode_surroundescape(s): return s.decode('latin1').translate(_table) In [15]: data = b'\xff' * 1024

[issue27350] Compact and ordered dict

2016-06-22 Thread INADA Naoki
INADA Naoki added the comment: Thank you, mark. I've added PY_INT16_T and PY_UINT16_T for windows, too. https://github.com/methane/cpython/pull/1/commits/dfaa44c051b2dbf580701729944cd0fda00cb541 https://github.com/methane/cpython/pull/1/commits/af80dc27dd381af9d211792963a23c5cecfa7009 I'll

[issue27350] Compact and ordered dict

2016-06-22 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43509/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-22 Thread INADA Naoki
INADA Naoki added the comment: FYI, bench result of USABLE_FRACTION(n) = (n/2): Report on Linux ip-10-0-1-249 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-1 (2016-03-06) x86_64 Total CPU cores: 2 +--+-++--++ | Benchmark

[issue27350] Compact and ordered dict

2016-06-21 Thread INADA Naoki
INADA Naoki added the comment: As I posted to python-dev ML, this compact ordered dict doesn't keep insertion order for key-shared dict. >>> class A: ... ... ... >>> a = A() >>> b = A() >>> a.a = 1 >>> a.b = 2 >>> b.b = 3 >>&g

[issue27350] Compact and ordered dict

2016-06-18 Thread INADA Naoki
New submission from INADA Naoki: I've implemented compact ordered dictionary, introduced in PyPy blog [1]. To finish my work, I really need core developer's help. Please see TODO comment in the patch. [1]: https://morepypy.blogspot.jp/2015/01/faster-more-memory-efficient-and-more.html See

[issue27350] Compact and ordered dict

2016-06-18 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- type: -> resource usage ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue27350] Compact and ordered dict

2016-06-19 Thread INADA Naoki
INADA Naoki added the comment: Make sense! I did it. -- Added file: http://bugs.python.org/file43467/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27350] Compact and ordered dict

2016-06-19 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43465/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-19 Thread INADA Naoki
INADA Naoki added the comment: >> How to support sizeof(Py_ssize_t) == 4? >#if SIZEOF_VOID_P == 4 Thanks! >> Can I use int8_t, int16_t and int32_t > You can use PY_INT32_T for 32-bit signed integers, short for 16-bit signed > integers (if SIZEOF_SHORT == 2) and signed

[issue27350] Compact and ordered dict

2016-06-19 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43480/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-19 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43472/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-20 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43484/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-23 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43520/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue27350] Compact and ordered dict

2016-06-28 Thread INADA Naoki
INADA Naoki added the comment: Anyone can review this by Python 3.6a3 ? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27350> ___ __

[issue27350] Compact and ordered dict

2016-06-26 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: Added file: http://bugs.python.org/file43542/compact-dict.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue10401] Globals / builtins cache

2016-01-27 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- nosy: +naoki ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10401> ___ __

[issue26172] iBook can't open ePub

2016-01-20 Thread INADA Naoki
New submission from INADA Naoki: Script cannot run in iBook is included in ePub. Attached patch resolves the issue. -- assignee: docs@python components: Documentation files: epub.patch keywords: patch messages: 258734 nosy: docs@python, naoki priority: normal severity: normal status

[issue25907] Documentation i18n: Added trans tags in sphinx templates

2016-01-23 Thread INADA Naoki
INADA Naoki added the comment: O/T Hi, Julien. I'm maintainer of Python Document Japanese translation project. (http://docs.python.jp/ ) We use Transifex to ease many volunteers working on translating. https://www.transifex.com/python-doc-ja/python-35/dashboard/ Repository of Python 3.5

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-03-03 Thread INADA Naoki
INADA Naoki added the comment: I've tried LTO without PGO in Debian Jessie. $ LTOFLAGS='-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none' $ CFLAGS=$LTOFLAGS LDFLAGS=$LTOFLAGS ./configure --prefix=... $ make -j32 results is here (compared with neither LTO and PGO): Test

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-03-04 Thread INADA Naoki
INADA Naoki added the comment: The machine is Google Compute Engine n1-highcpu-32 (Intel Ivy Bridge) Linux bench 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux cpuinfo: processor : 31 vendor_id : GenuineIntel cpu family : 6 model

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-03-03 Thread INADA Naoki
INADA Naoki added the comment: Sorry my poor English. I meant that "Does `./configure --with-lto && make` use LTO?". -- ___ Python tracker <rep...@bugs.python.org> <http:/

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-03-04 Thread INADA Naoki
INADA Naoki added the comment: > For sure you are not the only user that has active workloads on the physical > machine while you do benchmarks :) I think largest machine type I chosen (32core) can avoid sharing physical machine with other users. > On the other hand, the path you

  1   2   3   4   5   6   7   8   9   10   >