[issue9969] tokenize: add support for tokenizing 'str' objects

2010-11-20 Thread Abhay Saxena

Abhay Saxena  added the comment:

If the goal is tokenize(...) accepting a text I/O readline, we already have the 
(undocumented) generate_tokens(readline).

--
nosy: +ark3

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



[issue7804] test_readline failure

2010-11-20 Thread Abhay Saxena

Abhay Saxena  added the comment:

Works for me with a fresh py3k on Ubuntu.

--
nosy: +ark3

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



[issue9909] request for calendar.dayofyear() function

2010-11-20 Thread Abhay Saxena

Abhay Saxena  added the comment:

The test is incorrect on leap years for February 29, due to the way it 
constructs its list of dates. The function itself appears to give the right 
answer.

--
nosy: +ark3

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



[issue9909] request for calendar.dayofyear() function

2010-11-20 Thread Abhay Saxena

Abhay Saxena  added the comment:

Quick hack alternative test. It would look nicer if the test used the datetime 
module, but I'm not sure that would be appropriate.


def test_dayofyear(self):   
   
"""Test for the calendar.dayofyear() function, which computes the   
   
integer between 1 and 366 (inclusive) representing the specified day in 
   
the specified month of the specified year.  
   

   
""" 
   
for expected_total, year in (366, 2008), (365, 2010):   
   
expected_day_of_year = 1
   
for month in range(1, 13):  
   
lastDay = calendar.mdays[month] 
   
if year == 2008 and month == 2: 
   
lastDay = 29
   
for day in range(1, lastDay + 1):   
   
day_of_year = calendar.dayofyear(year, month, day)  
   
self.assertEqual(expected_day_of_year, day_of_year) 
   
# The computed day of the year must be between 1 and 366.   
   
self.assertGreaterEqual(day_of_year, 1) 
   
self.assertLessEqual(day_of_year, 366)  
   
expected_day_of_year += 1   
   
self.assertEqual(expected_day_of_year - 1, expected_total)

--

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