[issue15812] inspect.getframeinfo() cannot show first line

2016-12-05 Thread Peter Waller

Peter Waller added the comment:

I have just hit this bug and independently invented the exact fix of changing 
the zero for a one. Any chance of getting this merged?

--
nosy: +Peter.Waller

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



[issue8668] Packaging: add a 'develop' command

2011-06-16 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

Hi - Great to see this functionality coming. There is one feature of it that I 
would really like to see fixed, which is currently broken in 
setuptools/distribute - I'm sorry if this is the wrong forum for this note, but 
I wanted to add it to the discussion somewhere.

That feature is the package_dir argument to setup(). If the sources aren't in 
the root directory, the package doesn't function correctly with `python 
setup.py develop`

Here is a reference to an issue filed against distribute:

https://bitbucket.org/tarek/distribute/issue/177/setuppy-develop-doesnt-support-package_dir-arg-to

Is there any possibility of seeing this work correctly? A lot of packages use 
it, and for them, `develop` is currently broken.

Apologies if this feature is implemented and I missed it, but I see no 
reference to package_dir in the patch, so I would be (pleasantly) surprised 
if it was implemented. I would be happy to provide a testcase on request.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1711800] SequenceMatcher bug with insert/delete block after replace

2011-06-15 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

Apologies for the bump, but it has been more than a year and I did attach a 
patch! :-)

What next?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1711800
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8668] Packaging: add a 'develop' command

2011-06-15 Thread Peter Waller

Changes by Peter Waller peter.wal...@gmail.com:


--
nosy: +Peter.Waller

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8668
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller

New submission from Peter Waller peter.wal...@gmail.com:

Apologies if there is a way of doing this, but I haven't been able to find 
anything.

I need to be able to do the following:

my_tuple = namedtuple(my_tuple, a b c)
obj = my_tuple(1,2,3)

if isinstance(obj, namedtuple):
.. do stuff ..

The best I could come up with for the moment is:

if isinstance(obj, tuple) and type(obj) is not tuple:
.. do stuff ..

--
messages: 98437
nosy: pwaller
severity: normal
status: open
title: No way to find out if an object is an instance of a namedtuple
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

Hi Antoine and Eric, 

Thanks for your responses.

I need to be able to catch all named tuples, I don't know in advance what 
instance of a namedtuple it might be, but I want my function to only accept 
named tuples. Is this unreasonable?

(I am actually writing a C interface which does conversion from namedtuples to 
a form of RecordSpecification to do with databases. The namedtuple is 
arbitrarily created by the user.)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

In this case, I need to have names for each object. It is also desirable to use 
the namedtuple because of their lightweight nature.

If they were to subclass the namedtuple I would be happy to accept that, but I 
really do want them to pass some form of namedtuple to me, to have some sort of 
consistency. The named tuple gives an obvious simple interface for determining 
which fields are available and the order they are in.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7796] No way to find out if an object is an instance of a namedtuple

2010-01-27 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

Hi Amaury,

Thanks. I had heard of but never bothered to read about duck-typing before now; 
though I have used it passively before. I think it does make sense in this 
case. I can't imagine any case where checking for the _fields attribute would 
fail and isinstance(x, namedtuple) would not.

Besides which, for my current project I am forced to implement such a 
workaround anyway, so it doesn't affect me as such.

The only reason that remains why I would want it is that I often use 
isinstance(x, Y) to deal with different Ys, and that was the thing I 
intuitively wanted to use in this case as a python programmer for quite a few 
years now. This is probably a pretty weak reason, so I am happy to close this 
issue if the consensus points to duck typing.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7796
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue694374] Recursive regular expressions

2009-03-24 Thread Peter Waller

Peter Waller peter.wal...@gmail.com added the comment:

It looks like Matthew has dropped this feature from consideration.

See msg83993 .

--
nosy: +pwaller

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue694374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com