[issue38012] Python Fuction min is case sentive ?

2019-09-02 Thread Pavan Kumar Uppalanchu


New submission from Pavan Kumar Uppalanchu :

I have printed min('Infinity') and min('infinity') . 
Both are printing different characters. 
In first case , It's printing 'I' and in second case, it's printing 
'F'

--
messages: 351027
nosy: uppalanchupavankuma...@gmail.com
priority: normal
severity: normal
status: open
title: Python Fuction min is case sentive ?
type: behavior
versions: Python 3.7

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



[issue38012] Python Fuction min is case sentive ?

2019-09-02 Thread Pavan Kumar Uppalanchu


Pavan Kumar Uppalanchu  added the comment:

when I try to print min('Infinity') and min (InFinity). In first case, it's 
printing 'I' and in second case it's printing 'F'. Is this issue or working as 
Is ?

--

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



[issue38012] Python Fuction min is case sentive ?

2019-09-02 Thread Pavan Kumar Uppalanchu


Pavan Kumar Uppalanchu  added the comment:

Hello Tim,

Thanks for your quick response.

Also, THE min("Infinity") is priniting "I".  Practically, the minimum
value is "e" right ?

Regards,
Pavan Uppalanchu

On Mon, Sep 2, 2019 at 11:31 PM Tim Peters  wrote:
>
>
> Tim Peters  added the comment:
>
> This has nothing in particular do with `min()`.  As strings, 'I' < 'i', and 
> 'F' < 'I'.  For example,
>
> >>> 'I' < 'i'
> True
>
> >>> sorted("InFinity")
> ['F', 'I', 'i', 'i', 'n', 'n', 't', 'y']
>
> That's all working as intended and as documented, so I'm closing this report.
>
> --
> nosy: +tim.peters -xtreak
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> <https://bugs.python.org/issue38012>
> ___

--

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



[issue38012] Python Fuction min is case sentive ?

2019-09-02 Thread Pavan Kumar Uppalanchu


Pavan Kumar Uppalanchu  added the comment:

Hello Karthikeyan,

Thank you very much for your valuable explanation.

Regards,
Pavan Uppalanchu

On Mon, Sep 2, 2019 at 11:28 PM Karthikeyan Singaravelan
 wrote:
>
>
> Karthikeyan Singaravelan  added the comment:
>
> Here min uses the ASCII value of the letters for comparison. So for 
> 'Infinity' 'I' (73) has the lowest value and for 'inFinity' 'F' (70) has the 
> lowest value as seen below.
>
> >>> list(map(lambda c: (c, ord(c)), 'Infinity'))
> [('I', 73), ('n', 110), ('f', 102), ('i', 105), ('n', 110), ('i', 105), ('t', 
> 116), ('y', 121)]
> >>> list(map(lambda c: (c, ord(c)), 'inFinity'))
> [('i', 105), ('n', 110), ('F', 70), ('i', 105), ('n', 110), ('i', 105), ('t', 
> 116), ('y', 121)]
>
> --
> nosy: +xtreak
>
> ___
> Python tracker 
> <https://bugs.python.org/issue38012>
> ___

--

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