[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2018-09-18 Thread Dogan

New submission from Dogan :

Hey there,

I believe I've come across a bug. It occurs when you try to lower() the Turkish 
uppercase letter "İ". Gonna explain it with example code since it's easier:

>>> len("Ş")
1
>>> len("Ş".lower())
1
>>> len("Ğ")
1
>>> len("Ğ".lower())
1
>>> len("Ö")
1
>>> len("Ö".lower())
1
>>> len("Ç")
1
>>> len("Ç".lower())
1
>>> len("İ")
1
>>> len("İ".lower())
2

When you lower() the Turkish uppercase letter “İ”, it returns a 2 chars long 
string with the first character being “i”, and the second being chr(775).

Should it not simply return “i”?

--
components: Unicode
messages: 325646
nosy: ezio.melotti, vstinner, zamsalak
priority: normal
severity: normal
status: open
title: lower() on Turkish letter "İ" returns a 2-chars-long string
type: behavior
versions: Python 3.6

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



[issue8310] dis.dis function skips new-style classes in a module

2010-04-04 Thread Ozgur Dogan Ugurlu

New submission from Ozgur Dogan Ugurlu :

The documentation says:

dis.dis([bytesource])
Disassemble the bytesource object. bytesource can denote either a module, a 
class, a method, a function, or a code object. For a module, it disassembles 
all functions. For a class, it disassembles all methods. For a single code 
sequence, it prints one line per bytecode instruction. If no object is 
provided, it disassembles the last traceback.

And the behavior is correct for old-style classes. However, since the if check 
in the function dis.dis is like this:

if hasattr(x, '__dict__'):
items = x.__dict__.items()
items.sort()
for name, x1 in items:
if type(x1) in (types.MethodType,
types.FunctionType,
types.CodeType,
types.ClassType):

when given a module (x), it doesn't handle new-style classes which are 
types.TypeType. (types.ClassType are old-style classes)

A simple addition of types.TypeType to the list used by the inner if clause 
fixes the problem for me but I don't know if it could introduce another bug.

--
components: Library (Lib)
messages: 102338
nosy: dogeen
severity: normal
status: open
title: dis.dis function skips new-style classes in a module
type: behavior
versions: Python 2.6

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