[ python-Bugs-1296321 ] Python/C API Reference Manual, 7.2.1.1 Boolean Objects

2005-09-20 Thread SourceForge.net
Bugs item #1296321, was opened at 2005-09-20 19:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296321&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Li Daobing (nichloas)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python/C API Reference Manual, 7.2.1.1 Boolean Objects

Initial Comment:
1. PyBool_Check is double documented.

[1] http://www.python.org/doc/2.3.5/api/boolObjects.html

2. PyBool_FromLong's return type should be PyObject*,
this bug also in python2.4[2], the funtcion declaration
in header file[3][4] is 

PyAPI_FUNC(PyObject *) PyBool_FromLong(long);

[1] http://www.python.org/doc/2.3.5/api/boolObjects.html
[2] http://www.python.org/doc/2.4.1/api/boolObjects.html
[3] /usr/include/python2.3/boolobject.h
[4] /usr/include/python2.4/boolobject.h

Thanks


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296321&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1295909 ] inspect.getsource() misses single line blocks.

2005-09-20 Thread SourceForge.net
Bugs item #1295909, was opened at 2005-09-20 03:00
Message generated for change (Settings changed) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1295909&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ron Adam (ronadam)
>Assigned to: Hye-Shik Chang (perky)
Summary: inspect.getsource() misses single line blocks. 

Initial Comment:
While playing around with the inspect module I found
that the Blockfinder doesn't recognize single line
function definitions.

Adding the following two lines to it fixes it, but I'm
not sure if it causes problems anywhere else.


C:\Python24\Lib>diff.py inspect.py inspect_.py
*** inspect.py Tue Mar 15 13:22:02 2005
--- inspect_.py Mon Sep 19 14:26:26 2005
***
*** 531,536 
--- 531,538 
  raise EndOfBlock, self.last
  elif type == tokenize.NAME and scol == 0:
  raise EndOfBlock, self.last
+ elif self.indent == 0:
+ raise EndOfBlock, self.last

  def getblock(lines):
  """Extract the block of code at the top of the
given list of lines."""


Version info:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on win32


def test(t):
print '**',t,'**'
print "Line:"
def f(): pass
""" This line shouldn't be visible """
print inspect.getsource(f)

print "Block:"
def f():
pass
pass
"""This line should not be visible."""
print inspect.getsource(f)

import inspect
test("before")

import inspect_ as inspect
test("after")


#-- output --

** before **
Line:
def f(): pass
""" This line shouldn't be visible """
print inspect.getsource(f)

print "Block:"
def f():
pass
pass

Block:
def f():
pass
pass


** after **
Line:
def f(): pass

Block:
def f():
pass
pass



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1295909&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1296321 ] Python/C API Reference Manual, 7.2.1.1 Boolean Objects

2005-09-20 Thread SourceForge.net
Bugs item #1296321, was opened at 2005-09-20 13:56
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296321&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.3
>Status: Closed
>Resolution: Out of Date
Priority: 5
Submitted By: Li Daobing (nichloas)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python/C API Reference Manual, 7.2.1.1 Boolean Objects

Initial Comment:
1. PyBool_Check is double documented.

[1] http://www.python.org/doc/2.3.5/api/boolObjects.html

2. PyBool_FromLong's return type should be PyObject*,
this bug also in python2.4[2], the funtcion declaration
in header file[3][4] is 

PyAPI_FUNC(PyObject *) PyBool_FromLong(long);

[1] http://www.python.org/doc/2.3.5/api/boolObjects.html
[2] http://www.python.org/doc/2.4.1/api/boolObjects.html
[3] /usr/include/python2.3/boolobject.h
[4] /usr/include/python2.4/boolobject.h

Thanks


--

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-20 14:54

Message:
Logged In: YES 
user_id=1188172

Both are already fixed in 2.4 CVS.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296321&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1295909 ] inspect.getsource() misses single line blocks.

2005-09-20 Thread SourceForge.net
Bugs item #1295909, was opened at 2005-09-20 03:00
Message generated for change (Settings changed) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1295909&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Ron Adam (ronadam)
>Assigned to: Ka-Ping Yee (ping)
Summary: inspect.getsource() misses single line blocks. 

Initial Comment:
While playing around with the inspect module I found
that the Blockfinder doesn't recognize single line
function definitions.

Adding the following two lines to it fixes it, but I'm
not sure if it causes problems anywhere else.


C:\Python24\Lib>diff.py inspect.py inspect_.py
*** inspect.py Tue Mar 15 13:22:02 2005
--- inspect_.py Mon Sep 19 14:26:26 2005
***
*** 531,536 
--- 531,538 
  raise EndOfBlock, self.last
  elif type == tokenize.NAME and scol == 0:
  raise EndOfBlock, self.last
+ elif self.indent == 0:
+ raise EndOfBlock, self.last

  def getblock(lines):
  """Extract the block of code at the top of the
given list of lines."""


Version info:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310
32 bit (Intel)] on win32


def test(t):
print '**',t,'**'
print "Line:"
def f(): pass
""" This line shouldn't be visible """
print inspect.getsource(f)

print "Block:"
def f():
pass
pass
"""This line should not be visible."""
print inspect.getsource(f)

import inspect
test("before")

import inspect_ as inspect
test("after")


#-- output --

** before **
Line:
def f(): pass
""" This line shouldn't be visible """
print inspect.getsource(f)

print "Block:"
def f():
pass
pass

Block:
def f():
pass
pass


** after **
Line:
def f(): pass

Block:
def f():
pass
pass



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1295909&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1296433 ] expat crash python

2005-09-20 Thread SourceForge.net
Bugs item #1296433, was opened at 2005-09-20 18:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296433&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: XML
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Mike Rozhnov (rozhnov)
Assigned to: Nobody/Anonymous (nobody)
Summary: expat crash python

Initial Comment:
This simple script crash python.
Parsing of commented xml string work good.
(i.e. raised exception not crash python)
Buffer overflow during convertion to unicode?

Tested on Win XP and linux with kernel 2.4 with same
results.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296433&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1296434 ] Call by object reference sometimes call by value

2005-09-20 Thread SourceForge.net
Bugs item #1296434, was opened at 2005-09-20 08:11
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296434&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Alan G (abgrover)
Assigned to: Nobody/Anonymous (nobody)
Summary: Call by object reference sometimes call by value

Initial Comment:
The tutorial for 2.4.1, section 4.6 Defining Functions
states that formal parameters are introduced into the
local symbol table, making all calls call by object
reference.

The footnote points out that this means that changes to
mutable objects will be seen by the caller.  This is
also illustrated in the example involving calling the
list method append.

It would be helpful if the example could point out that
passing a value such as 1 passes an immutable object
(the constant integer value 1), and so it is impossible
to write code such as:

a = 1
def f(val):
  val = val + 1

and expect that after the call a == 2, even though val
== 2.  

My experience is that this is a confusing issue for new
users, who may not understand that val = val + 1 tosses
the object reference value passed, replacing it with a
new local object.  New users tend to see val as a
mutable object, since we just changed the value, didn't
we?  :)

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296434&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1296581 ] datetime.replace could take a dict

2005-09-20 Thread SourceForge.net
Bugs item #1296581, was opened at 2005-09-20 16:56
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296581&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
Priority: 5
Submitted By: Tom Lynn (tlynn)
Assigned to: Nobody/Anonymous (nobody)
Summary: datetime.replace could take a dict

Initial Comment:
Python 2.4.1.

datetime.replace uses its kwargs to specify the fields,
which I found a bit surprising.  It could also take an
equivalent dict.  (Failing that, it could have a fuller
docstring.)

What I was actually trying to do was round to the
nearest half hour.  floor and ceil methods taking a
timedelta would be nice too.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296581&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1296581 ] datetime.replace could take a dict

2005-09-20 Thread SourceForge.net
Bugs item #1296581, was opened at 2005-09-20 16:56
Message generated for change (Settings changed) made by tlynn
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296581&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Feature Request
Status: Open
Resolution: None
>Priority: 1
Submitted By: Tom Lynn (tlynn)
Assigned to: Nobody/Anonymous (nobody)
Summary: datetime.replace could take a dict

Initial Comment:
Python 2.4.1.

datetime.replace uses its kwargs to specify the fields,
which I found a bit surprising.  It could also take an
equivalent dict.  (Failing that, it could have a fuller
docstring.)

What I was actually trying to do was round to the
nearest half hour.  floor and ceil methods taking a
timedelta would be nice too.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1296581&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1297059 ] Incorrect return type for search() method

2005-09-20 Thread SourceForge.net
Bugs item #1297059, was opened at 2005-09-21 00:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1297059&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Noah Spurrier (noah)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect return type for search() method

Initial Comment:

The documentation for search() method of the IMAP4
object says 
that it returns a string, but it actually returns a tuple.
>>> print imaplib.IMAP4.search.__doc__
Search mailbox for matching messages.

(typ, [data]) = .search(charset,
criterion, ...)

'data' is space separated list of matching
message numbers.

Error can be seen in docs on page:
http://docs.python.org/lib/imap4-objects.html

Yours,
Noah



--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1297059&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com