[issue1063] Small typo in properties example

2007-08-30 Thread Carsten Grohmann

New submission from Carsten Grohmann:

The example for property() contains a typo / small bug:

class C(object):
def __init__(self): self.__x = None
[...]

should be:

class C(object):
def __init__(self): self._x = None
[...]

Source: http://docs.python.org/lib/built-in-funcs.html

--
components: Documentation
messages: 55505
nosy: cgrohmann
severity: minor
status: open
title: Small typo in properties example
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1063>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10813] Suppress adding decimal point for places=0 in moneyfmt()

2011-01-03 Thread Carsten Grohmann

New submission from Carsten Grohmann :

Hi,

the documentation of the decimal module contains a small recipe called 
moneyfmt() for format decimal values. It's very usefull.

I'd like to suggest a small improvement because the output is incorrect with 
given dp="." (default) and places=0.

Example:
>>> moneyfmt(decimal.Decimal('-0.02'), neg='<', trailneg='>', places=1)
'<0.0>'
>>> moneyfmt(decimal.Decimal('-0.02'), neg='<', trailneg='>', places=0)
'<0.>'

Change:
--- moneyfmt.py 2011-01-03 13:56:32.774169788 +0100
+++ moneyfmt.py.new 2011-01-03 13:56:58.130165330 +0100
@@ -33,7 +33,8 @@
 build(trailneg)
 for i in range(places):
 build(next() if digits else '0')
-build(dp)
+if places:
+build(dp)
 if not digits:
 build('0')
 i = 0

What do you think about the change?

Regrads,
Carsten

--
assignee: d...@python
components: Documentation
messages: 125164
nosy: cgrohmann, d...@python
priority: normal
severity: normal
status: open
title: Suppress adding decimal point for places=0 in moneyfmt()

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



[issue10813] Suppress adding decimal point for places=0 in moneyfmt()

2011-01-06 Thread Carsten Grohmann

Carsten Grohmann  added the comment:

Setting dp to an empty string is only a workaround from my perspective.

I get the value of the places parameter from a configuration instance and have 
to implement an additional check "places == 0" every time I call the original 
moneyfmt(). To reduce this effort I've changed my moneyfmt() function and 
applied the patch above.

I see only a valuable posibilities from my perspective: apply the patch. 
Because it would simplify life a little bit :-)

At end it's up to you because the current documentation stated "dp: ... only 
specify as blank when places is zero".

Regards,
Carsten

--

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



[issue3185] Documentation of time.time() differs from source documentation

2008-06-23 Thread Carsten Grohmann

New submission from Carsten Grohmann <[EMAIL PROTECTED]>:

The current python documentation of the time module
(http://docs.python.org/lib/module-time.html) means that time.time()
returns the "seconds since the epoch, in UTC".

But in the current source documentation of the time module
(http://svn.python.org/view/python/trunk/Modules/timemodule.c?rev=64048&view=markup)
is written that "time() -- return current time in seconds since the Epoch". 

time.time() returns the current local unix seconds during tests on a
system using Python 2.5.

Please adapt the documentation.

Thanks,
Carsten

--
assignee: georg.brandl
components: Documentation
messages: 68666
nosy: cgrohmann, georg.brandl
severity: normal
status: open
title: Documentation of time.time() differs from source documentation
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3185] Documentation of time.time() differs from source documentation

2008-06-23 Thread Carsten Grohmann

Carsten Grohmann <[EMAIL PROTECTED]> added the comment:

"current local unix seconds" means seconds since the Epoch in local
timezone.

I've attached a small example to show that is no difference between the
time returned by time.localtime() and time.time(). So I assume that
time.time() also returns local time and not UTC.

>>> time.mktime(time.localtime())
1214290130.0
>>> time.time()
1214290130.697067

___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3185>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2648] decimal receipe moneyfmt suppress leading 0

2008-04-17 Thread Carsten Grohmann

New submission from Carsten Grohmann <[EMAIL PROTECTED]>:

The current version of the receipe moneyfmt doesn't have a leading "0" 
for 1 < value < -1.

The attached patch adds a new parameter "zero". The parameter is empty 
per default and can set to "0" print a leading "0". The examples are 
updated also.

Possibly the new option should be "0" per default.

Regards,
Carsten

--
assignee: georg.brandl
components: Documentation
files: moneyfmt.diff
keywords: patch
messages: 65581
nosy: cgrohmann, georg.brandl
severity: normal
status: open
title: decimal receipe moneyfmt suppress leading 0
versions: Python 2.5
Added file: http://bugs.python.org/file10046/moneyfmt.diff

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2648>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11159] Sax parser crashes if given unicode file name

2012-12-08 Thread Carsten Grohmann

Changes by Carsten Grohmann :


--
nosy: +cgrohmann

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



[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2014-12-27 Thread Carsten Grohmann

Changes by Carsten Grohmann :


--
nosy: +cgrohmann

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