[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Terry, Thanks. > When responding by email, please snip the quotation and footer, except > possibly a line of the quoted message. My email client played an evil (and a bit embarrassing) trick with me, showing Larry's name without an actual em

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Well, the current code looks for __init__ or __new__. The only ones it can find is the 'object.__init__' which are blacklisted, because they are in C. The question is do (or will) 'object.__new__' or '__init__' have a sign

[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: > Otherwise we run the risk of introducing unexpected exceptions into > introspection code. That's a good catch. I'll make a new patch, keeping the old implementation of getfullargsspec intact, and falling back to it if no signat

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: In this case it would probably be best to just special case classes that don't have __init__ or __new__ defined to return an empty signature without parameters. I can also make a special case for object.__init__ and object.__new__ functions, if someone

[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: >> Otherwise we run the risk of introducing unexpected exceptions into >> introspection code. > That's a good catch. I'll make a new patch, keeping the old implementation of > getfullargsspec intact, and falling back to it if no s

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Please take a look at the attached patch (signature_plain_cls_01.patch) Now, the patch addresses two kind of classes: class C: pass and class C(type): pass For metaclasses, signature will return a signature with three positional-only parameters - (name

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Couple of thoughts: 1. "(object_or_name, [bases, dict])" is a signature for the "type" function, and yes, on that we need to agree how it looks like. Maybe exactly as you proposed, as it is what it is after all. 2. For user-defined

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: When in doubt, import this ;) Agree. So the best course would be: make a patch for plain classes (not metaclasses). Fix signatures for metaclasses without __init__/__new__ when we have groups support for parameters, so that we can have (obj_or_name, [bases

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: Attached is a stripped down patch that special-cases classes without __init__/__new__. Not metaclasses, for that we can start a new issue. -- Added file: http://bugs.python.org/file33557/signature_plain_cls_02.patch

[issue17481] inspect.getfullargspec should use __signature__

2014-01-19 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury: fire away, either here or in a new issue as is best. (Sorry, brain > mildly fried, not sure what would be best issue-tracker hygiene.) Larry, I ended up with a relatively big core dump of my thoughts, so I decided to post it on python-dev.

[issue17481] inspect.getfullargspec should use __signature__

2014-01-20 Thread Yury Selivanov
Yury Selivanov added the comment: > Instead of keeping the check, we could just unconditionally convert > exceptions from the signature call to a TypeError in order to maintain > compatibility with the old external behaviour. Agreed. See the new patch (getargsspec_02.patch) Unfortun

[issue20313] inspect.signature should raise ValueError for builtins with no signature info

2014-01-20 Thread Yury Selivanov
New submission from Yury Selivanov: 'inspect.signature' currently returns 'None' for builtins with no signature information. However, the protocol is that it raises a "ValueError(callable is not supported by signature)" if object is callable, but a signature c

[issue17481] inspect.getfullargspec should use __signature__

2014-01-20 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, I created a separate issue for that: http://bugs.python.org/issue20313 -- ___ Python tracker <http://bugs.python.org/issue17

[issue20313] inspect.signature should raise ValueError for builtins with no signature info

2014-01-20 Thread Yury Selivanov
Yury Selivanov added the comment: I see. Could you please incorporate the doc change and unittests into the patch for #20189? -- ___ Python tracker <http://bugs.python.org/issue20

[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +georg.brandl, ncoghlan ___ Python tracker <http://bugs.python.org/issue20267> ___ ___ Python-bugs-list mailing list Unsub

[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov
Yury Selivanov added the comment: This looks like a bug to me (or we should complain if a relative 'dir' was passed). I'm attaching a patch that fixes this, although I'm not sure if the unittest I wrote will work on windows. Moreover, 'mkstemp' and 'mktemp

[issue20267] TemporaryDirectory does not resolve path when created using a relative path

2014-01-20 Thread Yury Selivanov
Yury Selivanov added the comment: The patch is ok for windows. -- ___ Python tracker <http://bugs.python.org/issue20267> ___ ___ Python-bugs-list mailin

[issue20334] make inspect Signature hashable

2014-01-21 Thread Yury Selivanov
New submission from Yury Selivanov: inspect.Signature and inspect.Parameter are immutable structures, and it makes sense to make them hashable too. Patch is attached. -- components: Library (Lib) files: hashable_signature_01.patch keywords: patch messages: 208671 nosy: brett.cannon

[issue20334] make inspect Signature hashable

2014-01-21 Thread Yury Selivanov
Yury Selivanov added the comment: Fair enough. -- ___ Python tracker <http://bugs.python.org/issue20334> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20356] fix formatting of positional-only parameters in inspect.Signature

2014-01-22 Thread Yury Selivanov
New submission from Yury Selivanov: Fix formatting of positional-only parameters to use '/' as a separator for them from other kinds. This patch also makes 'Parameter.name' required, as well as being a valid identifier (as per discussion with Larry, Nick and Brett). -

[issue20356] fix formatting of positional-only parameters in inspect.Signature

2014-01-22 Thread Yury Selivanov
Yury Selivanov added the comment: One more patch revision: added versionchanged directive for the inspect.Parameter class docs. -- Added file: http://bugs.python.org/file33640/pos_only_format_02.patch ___ Python tracker <http://bugs.python.

[issue20356] fix formatting of positional-only parameters in inspect.Signature

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: I'd like to commit this one later today, so please take a look at the patch. -- ___ Python tracker <http://bugs.python.org/is

[issue17481] inspect.getfullargspec should use __signature__

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Nick, So what's the resolution on this one? Do I have a green light? -- ___ Python tracker <http://bugs.python.org/is

[issue20223] inspect.signature does not support new functools.partialmethod

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: > Reviewing the patch now. Nick, can I push this? -- ___ Python tracker <http://bugs.python.org/issue20223> ___ ___ Python-

[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-23 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue20326> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17373] Add inspect.Signature.from_callable()

2014-01-23 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue17373> ___ ___ Python-bugs-list mailing list Unsub

[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2014-01-23 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +belopolsky, yselivanov ___ Python tracker <http://bugs.python.org/issue20371> ___ ___ Python-bugs-list mailing list Unsub

[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: I've just quickly looked the issue: 1. There is an inconsistency between python & c implementations: datetime.replace always returns "datetime(...)" object, but should return "self.__class__()" 2. "new_datetime_ex&

[issue20372] inspect.getfile should raise a TypeError if C object does not have __module__

2014-01-23 Thread Yury Selivanov
New submission from Yury Selivanov: I'm not sure if it is right to fix the inspect module, instead of making all C objects to have the '__module__' attribute (is it even possible?), but if it is, the patch is attached. -- files: getfile_patch_01.patch keywords: patch m

[issue20204] pydocs fails for some C implemented classes

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: See issue #20372 -- fix for the 'inspect.getfile' function. -- ___ Python tracker <http://bugs.python.org/issue20204> ___ __

[issue20223] inspect.signature does not support new functools.partialmethod

2014-01-23 Thread Yury Selivanov
Yury Selivanov added the comment: > I'm not sure why you're asking Nick. Is he the release manager for 3.4? I'm asking him because he wrote "Reviewing the patch now.", and I thought that he might have actually seen the patch already. I'm more than fine

[issue20401] inspect.signature removes initial starred method params (bug)

2014-01-26 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, that's s bug. I'll take a look tomorrow. -- ___ Python tracker <http://bugs.python.org/issue20401> ___ ___

[issue20378] Implement `Signature.__repr__`

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Ram, yes, I agree. Something like '' should work. -- assignee: -> yselivanov ___ Python tracker <http://bugs.pytho

[issue20372] inspect.getfile should raise a TypeError if C object does not have __module__

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue20372> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20380] __defaults__ changed by *args

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: > Though perhaps a note in the documentation would be helpful for future > confused people. I agree. Also, __kwdefaults__ wasn't documented. Please take a look at the attached patch. -- keywords: +patch nosy: +yselivanov Added

[issue20380] __defaults__ changed by *args

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Ram, those are internal attributes. I.e. it's not recommended to use them directly, there are better instruments for that, such as 'inspect.signature'. Hence, I don't think that having an example/detailed explanation here

[issue17481] inspect.getfullargspec should use __signature__

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: > There's a major difference between getfullargspec/getargspec and > inspect.signature: getfullargspec shows you the "self" parameter for bound > methods, and inspect.signature does not. Larry, yes, that's correct. The attached p

[issue20356] fix formatting of positional-only parameters in inspect.Signature

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue20356> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue15185] Validate callbacks in 'contextlib.ExitStack.callback()'

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue15185> ___ ___ Python-bugs-list mailing list Unsub

[issue16490] "inspect.getargspec()" and "inspect.getcallargs()" don't work for builtins

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Closing this issue. See #17481 for details. -- resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Please take a look at the attached 'signature_plain_cls_04.patch'. This one supports classes (returns signature of 'object' builtin), and metaclasses (returns signature of 'type' builtin). -- Added file: ht

[issue20223] inspect.signature does not support new functools.partialmethod

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for the review, Nick. Closing the issue now. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue20372] inspect.getfile should raise a TypeError if C object does not have __module__

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed ___ Python tracker <http://bugs.python.org/issue20372> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20356] fix formatting of positional-only parameters in inspect.Signature

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed ___ Python tracker <http://bugs.python.org/issue20356> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue20401] inspect.signature removes initial starred method params (bug)

2014-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Patch is attached, please review. Should we commit this to 3.3 too? -- assignee: -> yselivanov keywords: +patch nosy: +ncoghlan Added file: http://bugs.python.org/file33758/signature_method_first_arg_01.pa

[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue20308> ___ ___ Python-bugs-list

[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-28 Thread Yury Selivanov
New submission from Yury Selivanov: Right now it may return `None` if no signature can be returned for the given builtin. If we decide to implement #17373 in 3.5, I'd like all three methods -- from_builtin, from_function, from_callable -- to either return a signature or to raise an exce

[issue20401] inspect.signature removes initial starred method params (bug)

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: Committed. Thank you, Terry. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue17481] inspect.getfullargspec should use __signature__

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: Larry and Nick, Please review the final patch (getargsspec_04.patch). I'd like to commit it tomorrow. This one is the last one (hopefully), and it supports builtin methods properly -- i.e. works around 'self' parameter correctly. To do that,

[issue17481] inspect.getfullargspec should use __signature__

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- keywords: +needs review ___ Python tracker <http://bugs.python.org/issue17481> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20425] inspect.Signature should work on decorated builtins

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- keywords: +needs review ___ Python tracker <http://bugs.python.org/issue20425> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20425] inspect.Signature should work on decorated builtins

2014-01-28 Thread Yury Selivanov
New submission from Yury Selivanov: inspect.signature should work with decorated builtins. Suppose I want to create a cached version of 'min' builtin: cached_min = functools.lru_cache()(min) The signature of the 'cached_min' should match the signature of 'min

[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: A patch is attached, please review. -- keywords: +needs review, patch stage: -> patch review Added file: http://bugs.python.org/file33784/from_builtin_errors_01.patch ___ Python tracker <http://bugs.pyth

[issue20379] help(instance_of_builtin_class.method) does not display self

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: FWIW, I solved the first arg consistency for inspect.getfullargspec in #17481. The latest patch always shows the first argument (self) for both python-defined and C-defined methods. -- nosy: +yselivanov ___ Python

[issue15582] Enhance inspect.getdoc to follow inheritance chains

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue15582> ___ ___ Python-bugs-list mailing list Unsub

[issue19573] Fix the docstring of inspect.Parameter and the implementation of _ParameterKind

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue19573> ___ ___ Python-bug

[issue19573] Fix the docstring of inspect.Parameter and the implementation of _ParameterKind

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: Antony, the docstrings are fixed. Could you please provide a patch just for the _ParameterKind-Enum refactoring? I'll incorporate it into 3.5 then. -- assignee: docs@python -> yselivanov ___ Python tracke

[issue1764286] inspect.getsource does not work with decorated functions

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov versions: +Python 3.5 -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issue1764

[issue19140] inspect.Signature.bind() inaccuracies

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- assignee: -> yselivanov nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue19140> ___ ___ Python-bugs-list mai

[issue19140] inspect.Signature.bind() inaccuracies

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: Pushed in 3.4. Yann, thank you for the bug report and the patch! -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue20427] inspect.Signature should ensure that non-default params don't follow default ones

2014-01-28 Thread Yury Selivanov
New submission from Yury Selivanov: Right now it's possible to manually create signatures like "(a=1, b)". Patch is attached. -- assignee: yselivanov files: sig_validation_01.patch keywords: needs review, patch messages: 209598 nosy: brett.cannon, larry, ncoghlan, ysel

[issue11770] inspect.dir_static

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue11770> ___ ___ Python-bugs-list mailing list Unsub

[issue19281] add __objclass__ to the docs

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: Should we commit this in 3.4? -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue19281> ___ ___ Python-bug

[issue16808] inspect.stack() should return list of named tuples

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue16808> ___ ___ Python-bugs-list mailing list Unsub

[issue16808] inspect.stack() should return list of named tuples

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue16808> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12916] Add inspect.splitdoc

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue12916> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12916] Add inspect.splitdoc

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue12916> ___ ___ Python-bugs-list mailing list Unsub

[issue19239] add inspect functions to retrieve attributes from both old dir() and overridden dir()

2014-01-28 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue19239> ___ ___ Python-bug

[issue20427] inspect.Signature should ensure that non-default params don't follow default ones

2014-01-28 Thread Yury Selivanov
Yury Selivanov added the comment: New patch version: sig_validation_02.patch This one is a bit more correct--it uses Parameter's private '_partial_kwarg' to correctly validate partial signatures. -- Added file: http://bugs.python.org/file33787/sig_vali

[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Nick, thanks for the review. Committed. -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: > Signature.from_function() and Signature.from_builtin() should both also be > documented, but we may want to wait for PEP 457 and #17373 in Python 3.5 > before sorting all that out. I would like to wait till 3.5 too. Right now both of them ar

[issue20425] inspect.Signature should work on decorated builtins

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for the review! -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue20427] inspect.Signature should ensure that non-default params don't follow default ones

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue20427> ___ ___ Python-bugs-list

[issue17481] inspect.getfullargspec should use __signature__

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Committed. Thanks for the reviews! -- ___ Python tracker <http://bugs.python.org/issue17481> ___ ___ Python-bugs-list mailin

[issue17481] inspect.getfullargspec should use __signature__

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue17481> ___ ___ Python-bugs-list

[issue20438] inspect: Deprecate getfullargspec?

2014-01-29 Thread Yury Selivanov
New submission from Yury Selivanov: Should we finally deprecate getfullargspec? With the AC and positional-only parameters support, getfullargspec doesn't provide full information anymore. By deprecation I mean changing its existing note "Consider using the new Signature Object

[issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality

2014-01-29 Thread Yury Selivanov
New submission from Yury Selivanov: The ability to fine-tune formatting of Signature (currently Signature.__str__) might be useful for pydoc and idle. -- assignee: yselivanov messages: 209660 nosy: brett.cannon, larry, ncoghlan, terry.reedy, yselivanov priority: normal severity: normal

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Stefan, is this one still relevant? If it is, I can review it (I have a couple of things to improve) and push in 3.4, as it doesn't really change any API. -- nosy: +yselivanov versions: -Python 3.3 ___ P

[issue20231] Argument Clinic accepts no-default args after default args

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Should this one be closed now? FWIW, signature object validates this case now. -- dependencies: +Argument Clinic rollup patch, 2014/01/25 nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue20

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Sadly, there is nothing we can do about it, as we simply don't have absolute paths in __file__ attributes in your case. -- nosy: +yselivanov resolution: -> rejected status: open -> closed ___ Python tra

[issue8639] Allow callable objects in inspect.getfullargspec

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: This is now fixed in #17481. -- dependencies: +inspect.getfullargspec should use __signature__ nosy: +yselivanov resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/

[issue20011] Changing the signature for Parameter's constructor

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: I don't think this is a good idea, as it would require those who read with the code to know about this default. Explicit is definitely better than implicit in this case. -- nosy: +yselivanov resolution: -> rejected status: open -

[issue20442] inspect: Document Signature & Parameter constructors' signatures

2014-01-29 Thread Yury Selivanov
New submission from Yury Selivanov: inspect.Signature & inspect.Parameter classes lack clear documentation about their constructors. Patch is attached. -- files: signature_docs_01.patch keywords: patch messages: 209684 nosy: eric.araujo, ezio.melotti, georg.brandl, larry, ncog

[issue20438] inspect: Deprecate getfullargspec?

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue20438> ___ ___ Python-bugs-list mailing list Unsub

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Hm, maybe just for the imports? This simple script, run it directly: test.py: def foo(): pass print(foo.__code__.co_filename) "$ python3.4 test.py" will still print relative path "test.py". Hence, if you do 'os.chdir&

[issue15931] inspect.findsource fails after directory change

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Yes. I'll create an issue for that. -- ___ Python tracker <http://bugs.python.org/issue15931> ___ ___ Python-bugs-list m

[issue20443] __code__. co_filename should always be an absolute path

2014-01-29 Thread Yury Selivanov
New submission from Yury Selivanov: There are many issues on tracker related to the relative paths in co_filename. Most of them are about introspection functions in inspect module--which are usually broken after 'os.chdir'. Test case: create a file t.py: def foo(): pass

[issue20443] __code__. co_filename should always be an absolute path

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +ncoghlan ___ Python tracker <http://bugs.python.org/issue20443> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16991] Add OrderedDict written in C

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Can we still merge this in 3.4? -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue16991> ___ ___ Python-bug

[issue20442] inspect: Document Signature & Parameter constructors' signatures

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed status: open -> closed ___ Python tracker <http://bugs.python.org/issue20442> ___ ___ Python-bugs-list

[issue18801] inspect.classify_class_attrs() misclassifies object.__new__()

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Tim, Eric, Please review the attached patch. -- keywords: +patch nosy: +tim.peters, yselivanov Added file: http://bugs.python.org/file33809/inspect_classify_01.patch ___ Python tracker <http://bugs.python.

[issue19658] inspect.getsource weird case

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Duplicate of #17526. -- nosy: +yselivanov resolution: -> duplicate status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue15731] Mechanism for inheriting docstrings and signatures

2014-01-29 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov versions: +Python 3.5 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue15731> ___ ___ Python-bug

[issue15731] Mechanism for inheriting docstrings and signatures

2014-01-29 Thread Yury Selivanov
Yury Selivanov added the comment: Perhaps, something like @functools.inherit decorator could help: https://gist.github.com/1st1/8703533 (just a quick illustration). -- ___ Python tracker <http://bugs.python.org/issue15

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-30 Thread Yury Selivanov
Yury Selivanov added the comment: Stefan, I'm attaching a reviewed patch--was a bit easier to rebase it on the new code and fix the remaining issues. Please review. BTW, do cython functions have __name__ attribute? -- assignee: -> yselivanov Added file: http://bugs.py

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-30 Thread Yury Selivanov
Yury Selivanov added the comment: Attached is a second patch (sig_func_ducktype_02.patch), with a bit improved tests (and a small bug fixed). Larry, do you think it's OK if I merge this one in 3.4? Technically, it's a feature that we start to support Cython functions in inspect.sign

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-31 Thread Yury Selivanov
Yury Selivanov added the comment: Third version of the patch is attached (sig_func_ducktype_03.patch). Changes: - Toughen the tests for duck-typed function -- do not accept classes - Added comments to clarify the need of duck-typing - NEWS item - what's new item Stefan, please take a lo

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-31 Thread Yury Selivanov
Changes by Yury Selivanov : Removed file: http://bugs.python.org/file33836/sig_func_ducktype_03.patch ___ Python tracker <http://bugs.python.org/issue17159> ___ ___ Pytho

[issue17159] Remove explicit type check from inspect.Signature.from_function()

2014-01-31 Thread Yury Selivanov
Changes by Yury Selivanov : -- keywords: +patch Added file: http://bugs.python.org/file33837/sig_func_ducktype_03.patch ___ Python tracker <http://bugs.python.org/issue17

[issue18801] inspect.classify_class_attrs() misclassifies object.__new__()

2014-01-31 Thread Yury Selivanov
Yury Selivanov added the comment: Not sure if we need to backport this to older python versions -- ___ Python tracker <http://bugs.python.org/issue18801> ___ ___

<    13   14   15   16   17   18   19   20   21   22   >