[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > To avoid the wasted memory and import time, it's better to use: > > try: >from _cmodule import * > except ImportError: >from _pymodule import * > .. also this makes it harder to prototype things in Python or have mix

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Thu, Jun 17, 2010 at 10:32 AM, Antoine Pitrou wrote: .. >> Is there direct regrtest support for this? > > You can take a look at test_io, test_memoryio or test_heapq for inspiration. > I looked at test_io and don't like that ap

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > The only alternative is to manually duplicate tests, these leads to very > poor test coverage because of the average developer's laziness (json is > an example). No, here is another alternative: ==> _example.py <== def foo()

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Porting PyPy implementation to 2.7 was fairly easy. I am posting the patch which makes PyPy datetime.py pass regression tests when dropped in the trunk. I expect 3.x port to be uneventful as well. Raising the priority because I would like to check

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: issue6641a.diff fixes the nits that Mark found and makes the tests robust with respect to change of timezones. Tested with all timezones avalilable on OSX including TZ="Eire". (Ever heard of Ouagadougou?) Parsing RFC 3339's HH:MM forma

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82053. -- ___ Python tracker <http://bugs.python.org/issue6641> ___ ___ Python-bugs-list mailing list Unsub

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: commit review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue5023] Segfault in datetime.time.strftime("%z")

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Since this does not seem to be reproducible anymore, I am going to close this soon. -- resolution: -> works for me status: open -> pending ___ Python tracker <http://bugs.python.org/

[issue1726687] Bug found in datetime for Epoch time = -1

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Is this important enough to try to get in 2.7 before rc2? Victor? -- components: +Extension Modules -None type: -> behavior versions: +Python 3.2 -Python 2.5, Python 3.1 ___ Python tracker &l

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Also, this should not be marked as high priority. It may be a > personal priority for you, ... Reverting priority. I thought once an issue is assigned, the priority becomes the priority that assignee places on the issue. Sorry for the con

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: >> One, we should not blindly pull in the PyPy code >> without some core PyPy developer being in on this > > I concur.  Much of PyPy code is written for a restricted subset of > Python instead of clean, idiomatic modern Python.

[issue1726687] Bug found in datetime for Epoch time = -1

2010-06-17 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- priority: normal -> low stage: patch review -> unit test needed versions: +Python 3.1 -Python 2.7 ___ Python tracker <http://bugs.python.org/iss

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-17 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching datetime-sandbox-pypy.diff, a plain diff between six-year-old sandbox and pypy versions. (Plain diff is cleaner than unified diff.) You can see that the differences are trivial. I notice, however that original datetime implementation

[issue9025] Non-uniformity in randrange for large arguments.

2010-06-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue9025> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Reopening because the patch introduced a regression with respect to datetime subclasses: >>> class DT(datetime): pass ... >>> DT.strptime('', '') datetime.datetime(1900, 1, 1, 0, 0) a DT instance exp

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Attaching issue6641b.diff that fixes subclassing issue. Added tests for datetime subclass only to keep the patch focused. Adding tests for datetime and time subclasses will be natural in issue 1100942. -- Added file: http://bugs.python.org

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Replacing issue6641b.diff after fixing some spelling errors. Thanks, Ezio. -- Added file: http://bugs.python.org/file17709/issue6641b.diff ___ Python tracker <http://bugs.python.org/issue6

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file17708/issue6641b.diff ___ Python tracker <http://bugs.python.org/issue6641> ___ ___ Python-bug

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file17710/issue6641b.diff ___ Python tracker <http://bugs.python.org/issue6641> ___ ___ Python-bug

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file17709/issue6641b.diff ___ Python tracker <http://bugs.python.org/issue6641> ___ ___ Python-bug

[issue9025] Non-uniformity in randrange for large arguments.

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would prefer to see correct algorithm in stdlib and a recipe for how to reproduce old sequences for the users who care. -- ___ Python tracker <http://bugs.python.org/issue9

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Let me just add a story to show how an alternate python implementation may be useful for users. As I was porting datetime.py to 3.x, I saw many failures from pickle tests. It was not easy to figure out what was going on because C pickle code was

[issue6641] datetime.strptime doesn't support %z format ?

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82073. -- stage: unit test needed -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I was probably misled by Brett's assertion that 'it's not a matter of "if" but "when" datetime will get a pure Python version.' (msg106498) It looks like this is not a universally shared opinion. I am not read

[issue8990] array constructor and array.fromstring should accept bytearray.

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Thomas' patch does more than just allow bytearray. It allows any object that can present itself as a buffer with byte-size items. It is a bit unfortunate that such method will end up being called "fromstring" in 3.x.With string

[issue8990] array constructor and array.fromstring should accept bytearray.

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > This, to me, implies that .fromstring should accept bytearray (though > probably not general buffer objects). In 2.x, I understand .fromstring > to initialize an array from machine bytes read into a string, but not > .fromunicode. This is

[issue5904] strftime docs do not explain locale affect on result string

2010-06-18 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Victor, this is your chance to add French to Python docs! -- keywords: +easy nosy: +belopolsky, haypo ___ Python tracker <http://bugs.python.org/issue5

[issue9005] Year range in timetuple

2010-06-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: +patch Added file: http://bugs.python.org/file17722/issue9005.diff ___ Python tracker <http://bugs.python.org/issue9

[issue9005] Year range in timetuple

2010-06-19 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: needs patch -> patch review ___ Python tracker <http://bugs.python.org/issue9005> ___ ___ Python-bugs-list mai

[issue9005] Year range in timetuple

2010-06-19 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Note that a recently closed issue 7150 similarly tightened up datetime operations by making out of range dates raise OverflowError rather than produce non-sensible result. This case is not a clear cut, but now with timezone.utc available in datetime

[issue9034] datetime module should use int32_t for date/time components

2010-06-19 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : """ As an aside, I dislike the fact that the datetime module uses a C 'int' for date ordinals, and clearly assumes that it'll be at least 32 bits. int could be as small as 16 bits on some systems (small embedded systems

[issue9005] Year range in timetuple

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I raised this issue on python-dev and Guido said "OK." See "[Python-Dev] Year 0 and year 10,000 in timetuple", http://mail.python.org/pipermail/python-dev/2010-June/100682.html I am attaching a "commit ready" patch which

[issue9005] Year range in timetuple

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file17729/issue9005b.diff ___ Python tracker <http://bugs.python.org/issue9005> ___ ___ Python-bug

[issue9005] Year range in timetuple

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82128. -- stage: commit review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue9004] datetime.utctimetuple() should not set tm_isdst flag to 0

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: With timezone.utc available in datetime module, users should be encouraged to use dt.astimezone(timezone.utc).timetuple() instead of dt.utctimetuple(). Note that the later will set tm_isdst to -1. This observation can be used to argue for either of

[issue9051] Cannot pickle timezone instances

2010-06-21 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : >>> s = pickle.dumps(timezone.utc) >>> pickle.loads(s) Traceback (most recent call last): .. TypeError: ("Required argument 'offset' (pos 1) not found", , ()) -- assignee: belopolsky messages: 108313 nosy

[issue9052] 2.7rc2 fails test_urllib_localnet tests on OS X

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Looks like a duplicate of issue 8455. Leaving open so that someone else could sort out the priority. -- nosy: +belopolsky superseder: -> buildbot: test_urllib2_localnet failures (Connection refused) on Tiger build

[issue8455] buildbot: test_urllib2_localnet failures (Connection refused) on Tiger buildbot

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Apparently, the failure on OSX is due to the fact that urllib.proxy_bypass('localhost') returns True. This makes the opener to bypass the ProxyHandler that is explicitly set up to use the correct server port: def

[issue8455] buildbot: test_urllib2_localnet failures (Connection refused) on Tiger buildbot

2010-06-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In fact, urllib.proxy_bypass() returns True for any simple host name (i.e. any string without '.' in it): >>> proxy_bypass('xyz') True >>> proxy_bypass('') True >>> proxy_bypass('whatever&#x

[issue8455] buildbot: test_urllib2_localnet failures (Connection refused) on Tiger buildbot

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue8455> ___ ___ Python-bugs-list mailing list Un

[issue9052] 2.7rc2 fails test_urllib_localnet tests on OS X

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/issue9052> ___ ___ Pyth

[issue9051] Cannot pickle timezone instances

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: +easy, patch nosy: +mark.dickinson stage: unit test needed -> patch review Added file: http://bugs.python.org/file17738/issue8455.diff ___ Python tracker <http://bugs.python.org/iss

[issue9051] Cannot pickle timezone instances

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file17738/issue8455.diff ___ Python tracker <http://bugs.python.org/issue9051> ___ ___ Python-bug

[issue9051] Cannot pickle timezone instances

2010-06-21 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Added file: http://bugs.python.org/file17739/issue9051.diff ___ Python tracker <http://bugs.python.org/issue9051> ___ ___ Python-bug

[issue8999] Add Mercurial support to patchcheck

2010-06-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: A small suggestion: rather than having bool hg which means Mercurial if true and SVN if false, consider a string valued vc variable with 'svn' for SVN and 'hg' for Mercurial. This way it will be straightforward to add support for

[issue7900] posix.getgroups() failure on Mac OS X

2010-06-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Ronald, Please see my python-dev post in "red buildbots on 2.7" thread: http://mail.python.org/pipermail/python-dev/2010-June/100873.html I argue that we should apply a fix along the lines of no-darwin-ext.diff while waiting for Apple to

[issue9057] Distutils2 needs a home page

2010-06-22 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- components: +Documentation title: Needs a home page -> Distutils2 needs a home page type: -> feature request ___ Python tracker <http://bugs.python.org/

[issue9051] Cannot pickle timezone instances

2010-06-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Python version is fixed in sandbox and committed in r82154. -- ___ Python tracker <http://bugs.python.org/issue9

[issue7900] posix.getgroups() failure on Mac OS X

2010-06-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Martin's solution works. I don't think we need to worry about non-gcc compilers on OSX. I am attaching a patch with tests where getgroups to id -G comparison test is skipped if id -G shows more than 16 groups. Some of the added tests are s

[issue7900] posix.getgroups() failure on Mac OS X

2010-06-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Reposting from python-dev. See "os.getgroups() on MacOS X" <http://mail.python.org/pipermail/python-dev/2010-June/100960.html>. """ On Wed, Jun 23, 2010 at 2:08 AM, Ronald Oussoren wrote: .. >> >>> * [Ron

[issue9063] TZ examples in datetime.rst are incorrect

2010-06-23 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : With python started at the root of the source tree and TZ=US/Eastern in the environment, >>> exec(open('Doc/includes/tzinfo-examples.py').read()) >>> import os >>> os.environ['TZ'] 'US/Eastern'

[issue9063] TZ examples in datetime.rst are incorrect

2010-06-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The result given when Eastern tzinfo object is used is clearly wrong. The timezone shift should not change the actual time, but >>> x == x.astimezone(Eastern) False while >>> x == x.asti

[issue9063] TZ examples in datetime.rst are incorrect

2010-06-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Let's establish what is the correct wall clock sequence around EDT to EST transition: >>> import time >>> def print_time(s): ...tt = time.localtime(s) ...print(time.strftime('%c %z %Z', tt)) x = datetime(2010

[issue9048] no OS X buildbots in the stable list

2010-06-23 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> ronaldoussoren components: +Macintosh -None ___ Python tracker <http://bugs.python.org/issue9048> ___ ___ Py

[issue9051] Cannot pickle timezone instances

2010-06-23 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82184. Leaving the issue open pending a more thorough review of pickling in datetime module. -- keywords: -easy, patch priority: normal -> low ___ Python tracker <http://bugs.pyth

[issue9009] Improve quality of Python/dtoa.c

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > - ignore the rounding mode completely, always doing round-half-to-even. +1 -- ___ Python tracker <http://bugs.python.org/iss

[issue9070] Timestamps are rounded differently in py3k and trunk

2010-06-24 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : In the trunk: >>> datetime.utcfromtimestamp(0.994) datetime.datetime(1970, 1, 1, 0, 0, 1) In py3k: >>> datetime.utcfromtimestamp(0.994) datetime.datetime(1970, 1, 1, 0, 0, 0, 99) See issue1478429 - it appears th

[issue9070] Timestamps are rounded differently in py3k and trunk

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: My mistake. I had datetime.py from pypy in the directory from which I ran the trunk python. The problem is also in the latest sandbox version of datetime.py, but this is not yet part of cpython proper. Refiled as pypy bug at http://codespeak.net

[issue8860] Rounding in timedelta constructor is inconsistent with that in timedelta arithmetics

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Similar problem affects fromtimestamp() constructors: >>> datetime.fromtimestamp(0.0078125)-datetime.fromtimestamp(0) datetime.timedelta(0, 0, 7813) >>> datetime.utcfromtimestamp(0.0078125)-datetime.utcfromtimestamp(0) datetime.ti

[issue6608] asctime does not check its input

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've just noticed that time_strftime already has the range checks for tm structure fields. These checks can be separated in a function and shared with asctime. Marking this as "easy". See also issue897625. -- keyword

[issue9079] Make gettimeofday available in datetime module

2010-06-24 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Attached patch moves cross-platform logic of obtaining current time to _time.c which is shared between time and datetime modules. This simplifies both modules and reduces the datetime module dependency on the time module. -- assignee

[issue9079] Make gettimeofday available in datetime module

2010-06-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The new patch, issue9079.diff exposes gettimeofday as time.gettimeofday() returning (sec, usec) pair. -- Added file: http://bugs.python.org/file17767/issue9079.diff ___ Python tracker <http://bugs.python.

[issue9079] Make gettimeofday available in datetime module

2010-06-24 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : Removed file: http://bugs.python.org/file17766/gettimeofday.diff ___ Python tracker <http://bugs.python.org/issue9079> ___ ___ Python-bug

[issue9079] Make gettimeofday available in time module

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Mark, I am reassigning this to you for commit review. I am changing the title to reflect the visible part of the change. The datetime module gains direct access to system gettimeofday at the C level while time module grows time.gettimeofday() Python

[issue8860] Rounding in timedelta constructor is inconsistent with that in timedelta arithmetics

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: >> The timedelta(seconds=0.6112295) example is handled correctly > No, it's not! It's being rounded *up* where it should be > being rounded *down*. Let me try to reformulate the issue. When use is entering 0.6112295, she

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Deprecating the feature for 3.x is certainly an option. > May be a little drastic though. How drastic would be to stop subclassing datetime from date in 3.2? After all, we don't subclass flo

[issue1578643] various datetime methods fail in restricted mode

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: See issue9079. -- dependencies: +Make gettimeofday available in time module ___ Python tracker <http://bugs.python.org/issue1578

[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This proved to require a lot of changes to C implementation because most of timezone arithmetics is done using integer operations with offset in minutes. It is easy, however to do this in pure python implementation which can be found at http

[issue9051] Improve pickle format for aware datetime instances

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The datetime module provides compact pickled representation for date, datetime, time and timedelta instances: type: size date: 34 datetime: 44 time: 36 timedelta: 37 On the other hand, current pickle size for timezone is 64 and the size of an aware

[issue9079] Make gettimeofday available in time module

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I would very much appreciate Tim's input on datetime issues. This particular issue is fairly minor, but Tim's expertise will be invaluable for anything timezone related. I do appreciate the incredible amount of brainpower that went into the

[issue8947] Provide as_integer_ratio() method to Decimal

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Raymond, conversion to Fraction does not really help in my use case of supporting timedelta * Decimal by duck typing. I can think of many other use cases where it will be helpful to accept either float or decimal without loss of precision. Is there

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Here is a similar issue which may be easier to fix: >>> def f(a, b=None, *, c=None, d=None): ...pass >>> f(1,2,3) Traceback (most recent call last): File "", line 1, in TypeError: f() takes at most 4 arguments (3 g

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: belopolsky -> ___ Python tracker <http://bugs.python.org/issue2516> ___ ___ Python-bugs-list mailing list Un

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- ___ Python tracker <http://bugs.python.org/issue2516> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- ___ Python tracker <http://bugs.python.org/issue2516> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- ___ Python tracker <http://bugs.python.org/issue2516> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue2516] Instance methods are misreporting the number of arguments

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- ___ Python tracker <http://bugs.python.org/issue2516> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue9051] Improve pickle format for aware datetime instances

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am attaching a python prototype implementing interned UTC instance pickling. The patch is against sandbox revision r82218 of datetime.py. Note that the pickling protocol requires that an instance or factory function is defined at the module level

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Adding tim_one to the nosy list. Tim, It would be great if you could shed some light on the history behind pure python implementation. Why was it developed in the first place? What was the reason not to ship it with python? Thanks. -- nosy

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Tim, thanks for your prompt reply. What would be your opinion on adding datetime.py to the main python tree today? There is momentum behind several features to be added to datetime module and having easily accessible prototype would give similar

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > For io, we find this quite manageable indeed, although it is quite more > complex and quirkier than datetime. I don't understand how something being "more complex and quirkier," can make it more "manageable." While

[issue4775] Incorrect documentation - UTC time

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Python implementation of time functions certainly has nothing to do with UT1, which is the time as measured by (modern) sun dials. The correct name would be POSIX time. As explained in POSIX rationale, """ Coordinated Universal Time

[issue4775] Incorrect documentation - UTC time

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: """ The gmtime() function shall convert the time in seconds since the Epoch pointed to by timer into a broken-down time, expressed as Coordinated Universal Time (UTC). """ In a technical sense, this is correct. The resul

[issue9024] PyDateTime_IMPORT macro incorrectly marked up

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82236 - r82239. -- nosy: +belopolsky resolution: -> accepted stage: patch review -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python.o

[issue1520662] support all of strftime(3)

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: time.strftime does support all of the platform strftime(3) format codes. -- assignee: -> belopolsky nosy: +belopolsky resolution: -> out of date stage: -> committed/rejected status: open -

[issue5109] array.array constructor very slow when passed an array object.

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- assignee: -> belopolsky nosy: +belopolsky, mark.dickinson -Alexander.Belopolsky ___ Python tracker <http://bugs.python.org/iss

[issue5109] array.array constructor very slow when passed an array object.

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- stage: -> patch review ___ Python tracker <http://bugs.python.org/issue5109> ___ ___ Python-bugs-list mailing list Un

[issue762963] timemodule.c: Python loses current timezone

2010-06-25 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker <http://bugs.python.org/issue762963> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9024] PyDateTime_IMPORT macro incorrectly marked up

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Should also add :cvar: tag to PyDateTimeAPI. http://docs.python.org/documenting/markup.html#information-units Thanks, Ezio. -- assignee: d...@python -> belopolsky status: closed -> open ___ Python t

[issue3385] cPickle to pickle conversion in py3k missing methods

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Do I understand correctly that the issue is that python Pickler class has dispatch attribute but C Pickler does not? The add_dispatch_check-0.patch patch does not seem to add class attribute, it adds an instance attribute instead. I also noticed that

[issue762963] timemodule.c: Python loses current timezone

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I agree with Martin. A proper fix would be to use tm_gmtoff explicitly where available and carry it in time.struct_time. See issue1647654 and issue4086. Interestingly, the issue does not show up on OSX, which being a BSD derivative does have

[issue762963] timemodule.c: Python loses current timezone

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Another related issue is issue1667546. -- ___ Python tracker <http://bugs.python.org/issue762963> ___ ___ Python-bug

[issue9024] PyDateTime_IMPORT macro incorrectly marked up

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Committed in r82251. Thanks for the patch, Tim. -- status: open -> closed ___ Python tracker <http://bugs.python.org/iss

[issue7989] Add pure Python implementation of datetime module to CPython

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I see. I misunderstood AP's "although" as "however", but he probably meant "even though" or "in spite the fact that." Antoine, can I count you as "+1"? In any case, my threshold for moving thi

[issue655802] cPickle not always same as pickle

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: What is the status of this? issue1536 is an open documentation issue. Is this similarly a documentation enhancement request or there is a case when pickle and CPickle produce different and incompatible serializations? -- nosy: +belopolsky

[issue9089] PyNumber_Int is still mentioned in number protocol docs

2010-06-26 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : See http://docs.python.org/dev/py3k/c-api/number.html#PyNumber_Int I also noticed some left-over references to intobject in the comments in the py3k tree: Include/longobject.h:61:/* For use by intobject.c only */ Modules/xxmodule.c:13: intobject.h

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: If I disable _pickle, I get a more meaningful trace: File "Tools/pybench/pybench.py", line 954, in PyBenchCmdline() File "/Users/sasha/Work/python-svn/py3k-commit/Tools/pybench/CommandLine.py", line 349, in __init__ rc

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The bytes/string issu was a red herring: with pickle.load(open('27.bench', 'b')), I get the same stack trace as from command line pybench invocation. >>> pickle.load(open('27.bench', 'rb')) Traceba

[issue5180] 3.1 cannot unpickle 2.7-created pickle

2010-06-26 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Hmm. It looks like another pickle vs. _pickle issue. Attached patch is a result of 2to3 applied to Tools/pybench (and a minor manual fix for pickle import) with _pickle import disabled. With the patch applied, $ ./python Tools/pybench/pybench.py

[issue9093] Tools/README is out of date

2010-06-27 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Here is the list of subdirectories in Tools. Here is the diff between directory listing and readme ('-' means no readme entry, '+' - no tool): -buildbot -ccbench +audiopy +compiler faqwiz -framer freeze gdb i18n -iobench -

<    25   26   27   28   29   30   31   32   33   34   >