[issue28801] configparser: before_get() method of class Interpolation has positional 'parser' parameter that is not used.

2016-11-25 Thread Richard Prosser

Richard Prosser added the comment:

Ah. Something like self._interpolation.before_get(self, section, option, value, 
d) could be better written as self._interpolation.before_get(parser=self, ...) 
- but that would require keyword arguments to be used throughout.

I still don't grock the apparent 'get()' signature mis-match however.

--

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



[issue28801] configparser: before_get() method of class Interpolation has positional 'parser' parameter that is not used.

2016-11-25 Thread Richard Prosser

Richard Prosser added the comment:

Thanks for the prompt reply. I still don't fully understand yet but there 
aren't any errors reported so I presume that it is OK.

There is another related matter however: PyCharm (2016.2.3) indicates that a 
get() method signature does not match that of the Mapping class one ...

557
558class RawConfigParser(MutableMapping):

761
762def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):


There are other similar cases I believe.

So I am not sure what to make of that, either.

--
hgrepos: +363

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



[issue28801] configparser: before_get() method of class Interpolation has positional 'parser' parameter that is not used.

2016-11-25 Thread Richard Prosser

New submission from Richard Prosser:

>From https://hg.python.org/cpython/file/3.5/Lib/configparser.py (for example):

358class Interpolation:
359"""Dummy interpolation that passes the value through with no changes."""
360
361def before_get(self, parser, section, option, value, defaults):
362return value

but a typical invocation misses out the 'parser' parameter:

796return self._interpolation.before_get(self, section, option, 
value,
797  d)

As far as I can see, this is not a keyword-only parameter, yet PyCharm seems to 
treat it as one. So maybe this is some new behaviour that I don't understand 
yet but there seems to be a fault here, IMO.

I am using Python 3.5.2 on Windows 7, after using the 'futurize' tool on some 
legacy 2.7 code that extended self._interpolate (which no longer exists in 3+).

--
hgrepos: 362
messages: 281697
nosy: rprosser
priority: normal
severity: normal
status: open
title: configparser: before_get() method of class Interpolation has positional 
'parser' parameter that is not used.
type: compile error
versions: Python 3.5

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