mirror of
https://github.com/fschmnn/duodecimal.git
synced 2024-12-26 18:29:28 +00:00
2019.03.09 - fixed bug invalid character .'
This commit is contained in:
parent
4957c34e45
commit
30b53b759c
@ -95,8 +95,8 @@ class BaseConverter:
|
||||
else:
|
||||
sign = 1
|
||||
|
||||
if set(string) > set(digits):
|
||||
invalid = set(string) - set(digits)
|
||||
if set(string) > set(digits+'.'):
|
||||
invalid = set(string) - set(digits+'.')
|
||||
raise ValueError('invalid character'.format(invalid))
|
||||
|
||||
if '.' in string:
|
@ -12,10 +12,12 @@
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 1,
|
||||
"metadata": {},
|
||||
"metadata": {
|
||||
"collapsed": true
|
||||
},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"from duodecimal import BaseConverter, duo, binary"
|
||||
"from BaseConverter import BaseConverter, duo, binary"
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -208,7 +210,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 9,
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -217,7 +219,7 @@
|
||||
"1010(base2)"
|
||||
]
|
||||
},
|
||||
"execution_count": 9,
|
||||
"execution_count": 2,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@ -228,7 +230,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 26,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -237,7 +239,7 @@
|
||||
"False"
|
||||
]
|
||||
},
|
||||
"execution_count": 26,
|
||||
"execution_count": 3,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@ -248,7 +250,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 31,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@ -257,7 +259,7 @@
|
||||
"'42'"
|
||||
]
|
||||
},
|
||||
"execution_count": 31,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user