[issue26747] types.InstanceType only for old style class only in 2.7

2016-04-13 Thread Nan Wu

New submission from Nan Wu:

>>> import types
>>> a = 1
>>> isinstance(a, types.InstanceType)
False
>>> class A:
... pass
... 
>>> a = A()
>>> isinstance(a, types.InstanceType)
True
>>> class A(object):
... pass
... 
>>> a = A()
>>> isinstance(a, types.InstanceType)
False

Looks like isinstance(instance, types.InstanceType) only return True for 
user-defined old-style class instance. If it's the case, I feel doc should 
clarify that like what types.ClassType did. If no, someone please close this 
request. Thanks.

--
files: doc_InstanceType_is_for_old_style_cls.patch
keywords: patch
messages: 263338
nosy: Nan Wu
priority: normal
severity: normal
status: open
title: types.InstanceType only for old style class only in 2.7
type: enhancement
versions: Python 2.7
Added file: 
http://bugs.python.org/file42456/doc_InstanceType_is_for_old_style_cls.patch

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



[issue25783] test_traceback.test_walk_stack() fails when run directly (without regrtest)

2015-12-03 Thread Nan Wu

Nan Wu added the comment:

Put in a fix. Let me know if it looks ok.

--
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41232/fix_test_walk_stack_failed_as_script_patch

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



[issue25755] Test test_property failed if run twice

2015-12-03 Thread Nan Wu

Nan Wu added the comment:

Thanks for catching this failure. In the patch, property doc is restore after 
write operation.

--
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41233/fix_test_property_doc_writable_patch

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



[issue25651] Confusing output for TestCase.subTest(0)

2015-11-21 Thread Nan Wu

Nan Wu added the comment:

Made it check against None explicitly. My concern is if [] is passed in, if 
will show [[]]. But this case should be rare.

--
keywords: +patch
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file41115/subtest_msg_check_against_None.patch

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



[issue25609] Add a ContextManager ABC and type

2015-11-12 Thread Nan Wu

Nan Wu added the comment:

Hi Brett, I'd like work on this feature. Your description here is clear. 
Besides that, could you give a use case of this context manager?

--
nosy: +Nan Wu

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



[issue25567] shlex.quote doesn't work on bytestrings

2015-11-09 Thread Nan Wu

Nan Wu added the comment:

Added a patch for support this in `quote` method. What is a good example or a 
group of examples to demonstrate the usage in the document?

--
keywords: +patch
nosy: +Nan Wu
Added file: http://bugs.python.org/file40992/shlex_quote_bytes_support.patch

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



[issue25439] Add type checks to urllib.request.Request

2015-10-31 Thread Nan Wu

Nan Wu added the comment:

Martin: Sorry for missing that line.

Under https, byte iterable seems has not been supported:
>>> r = Request('https://www.python.org', {b'post': 'data'}, 
>>> {'Content-Length':10})
>>> urlopen(r)

... hanging here...

Meanwhile, I assumed bytearray works as expected.
>>> r = Request('https://www.python.org', bytearray('post=data', 'utf-8'))
>>> urlopen(r)


urllib.error.HTTPError: HTTP Error 403: FORBIDDEN

In *4.patch, I updated Request class doc to add these observations and fixed 
issues appeared in last patch.

--
Added file: 
http://bugs.python.org/file40912/urllib_request_param_type_check_4.patch

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



[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu

Nan Wu added the comment:

The do_request_() method which is defined in AbstractHTTPHandler seems not 
cover the check at least for the first case Ezio brought up. `unknown_open` has 
been called and gives out a relatively confusing message.

--

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



[issue25439] Add type checks to urllib.request.Request

2015-10-27 Thread Nan Wu

Nan Wu added the comment:

Will fix the other two issues. Thanks.

--

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



[issue25439] Add type checks to urllib.request.Request

2015-10-25 Thread Nan Wu

Changes by Nan Wu <nanbytesf...@gmail.com>:


Added file: 
http://bugs.python.org/file40850/urllib_request_param_type_check_3.patch

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-21 Thread Nan Wu

Nan Wu added the comment:

Updated the patch. The typo was fixed too. Thanks for the catching.

--
Added file: http://bugs.python.org/file40831/htmllib_deprecation_warning_2.patch

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



[issue25439] Add type checks to urllib.request.Request

2015-10-20 Thread Nan Wu

Nan Wu added the comment:

Uploaded a patch. Also update the test. Seems there are at least two old test 
cases using empty dict as data param. has dict been supported before?

--
keywords: +patch
nosy: +Nan Wu
Added file: 
http://bugs.python.org/file40819/urllib_request_param_type_check.patch

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



[issue25439] Add type checks to urllib.request.Request

2015-10-20 Thread Nan Wu

Nan Wu added the comment:

I see. Empty dict is considered as iterable of bytes makes good sense. I just 
left the old tests there. And explicitly give warnings when data field is of 
type str or type dict with non-bytes key.

--
Added file: 
http://bugs.python.org/file40830/urllib_request_param_type_check_2.patch

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



[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-16 Thread Nan Wu

Nan Wu added the comment:

Added a small patched for this change.

--
keywords: +patch
nosy: +Nan Wu
Added file: http://bugs.python.org/file40796/htmllib_deprecation_warning.patch

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



[issue25322] contextlib.suppress not tested for nested usage

2015-10-07 Thread Nan Wu

Nan Wu added the comment:

Added a patch with Martina's idea. Isn't ignored better set as false instead ? 
Since interpreter did not ignore it.

--
keywords: +patch
nosy: +Nan Wu
Added file: http://bugs.python.org/file40713/fix_reentrant_cm_test.patch

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



[issue25311] Add f-string support to tokenize.py

2015-10-07 Thread Nan Wu

Nan Wu added the comment:

Added 'f'/'F' to the StringPrefix regex and also update the quote dictionary.

--
keywords: +patch
nosy: +Nan Wu
Added file: http://bugs.python.org/file40712/tokenize.patch

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



[issue24479] Support LMMS project files in mimetypes.guess_type

2015-07-22 Thread Nan Wu

Nan Wu added the comment:

Added a small patch. Pls let me know if anything missed.

--
nosy: +bytesflow
Added file: 
http://bugs.python.org/file39989/issue24479_support_mmp_and_mmpz_suffix_in_guess_type

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24479
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com