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
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
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
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
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
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
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
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
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
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.
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
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
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
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
Changes by Yury Selivanov :
--
nosy: +georg.brandl, ncoghlan
___
Python tracker
<http://bugs.python.org/issue20267>
___
___
Python-bugs-list mailing list
Unsub
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
Yury Selivanov added the comment:
The patch is ok for windows.
--
___
Python tracker
<http://bugs.python.org/issue20267>
___
___
Python-bugs-list mailin
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
Yury Selivanov added the comment:
Fair enough.
--
___
Python tracker
<http://bugs.python.org/issue20334>
___
___
Python-bugs-list mailing list
Unsubscribe:
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).
-
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.
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
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
Yury Selivanov added the comment:
> Reviewing the patch now.
Nick, can I push this?
--
___
Python tracker
<http://bugs.python.org/issue20223>
___
___
Python-
Changes by Yury Selivanov :
--
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue20326>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue17373>
___
___
Python-bugs-list mailing list
Unsub
Changes by Yury Selivanov :
--
nosy: +belopolsky, yselivanov
___
Python tracker
<http://bugs.python.org/issue20371>
___
___
Python-bugs-list mailing list
Unsub
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&
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
Yury Selivanov added the comment:
See issue #20372 -- fix for the 'inspect.getfile' function.
--
___
Python tracker
<http://bugs.python.org/issue20204>
___
__
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
Yury Selivanov added the comment:
Yes, that's s bug. I'll take a look tomorrow.
--
___
Python tracker
<http://bugs.python.org/issue20401>
___
___
Yury Selivanov added the comment:
Ram, yes, I agree. Something like '' should work.
--
assignee: -> yselivanov
___
Python tracker
<http://bugs.pytho
Changes by Yury Selivanov :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20372>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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
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
Changes by Yury Selivanov :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20356>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue15185>
___
___
Python-bugs-list mailing list
Unsub
Yury Selivanov added the comment:
Closing this issue. See #17481 for details.
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
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
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
Changes by Yury Selivanov :
--
resolution: -> fixed
___
Python tracker
<http://bugs.python.org/issue20372>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Yury Selivanov :
--
resolution: -> fixed
___
Python tracker
<http://bugs.python.org/issue20356>
___
___
Python-bugs-list mailing list
Unsubscrib
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
Changes by Yury Selivanov :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20308>
___
___
Python-bugs-list
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
Yury Selivanov added the comment:
Committed. Thank you, Terry.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
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,
Changes by Yury Selivanov :
--
keywords: +needs review
___
Python tracker
<http://bugs.python.org/issue17481>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Yury Selivanov :
--
keywords: +needs review
___
Python tracker
<http://bugs.python.org/issue20425>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue15582>
___
___
Python-bugs-list mailing list
Unsub
Changes by Yury Selivanov :
--
nosy: +yselivanov
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue19573>
___
___
Python-bug
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
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
Changes by Yury Selivanov :
--
assignee: -> yselivanov
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue19140>
___
___
Python-bugs-list mai
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
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
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue11770>
___
___
Python-bugs-list mailing list
Unsub
Yury Selivanov added the comment:
Should we commit this in 3.4?
--
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue19281>
___
___
Python-bug
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue16808>
___
___
Python-bugs-list mailing list
Unsub
Changes by Yury Selivanov :
--
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue16808>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Yury Selivanov :
--
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue12916>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue12916>
___
___
Python-bugs-list mailing list
Unsub
Changes by Yury Selivanov :
--
nosy: +yselivanov
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue19239>
___
___
Python-bug
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
Yury Selivanov added the comment:
Nick, thanks for the review. Committed.
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
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
Yury Selivanov added the comment:
Thanks for the review!
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Yury Selivanov :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20427>
___
___
Python-bugs-list
Yury Selivanov added the comment:
Committed.
Thanks for the reviews!
--
___
Python tracker
<http://bugs.python.org/issue17481>
___
___
Python-bugs-list mailin
Changes by Yury Selivanov :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue17481>
___
___
Python-bugs-list
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
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
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
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
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
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/
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 -
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
Changes by Yury Selivanov :
--
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue20438>
___
___
Python-bugs-list mailing list
Unsub
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&
Yury Selivanov added the comment:
Yes. I'll create an issue for that.
--
___
Python tracker
<http://bugs.python.org/issue15931>
___
___
Python-bugs-list m
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
Changes by Yury Selivanov :
--
nosy: +ncoghlan
___
Python tracker
<http://bugs.python.org/issue20443>
___
___
Python-bugs-list mailing list
Unsubscribe:
Yury Selivanov added the comment:
Can we still merge this in 3.4?
--
nosy: +yselivanov
___
Python tracker
<http://bugs.python.org/issue16991>
___
___
Python-bug
Changes by Yury Selivanov :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20442>
___
___
Python-bugs-list
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.
Yury Selivanov added the comment:
Duplicate of #17526.
--
nosy: +yselivanov
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Yury Selivanov :
--
nosy: +yselivanov
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue15731>
___
___
Python-bug
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
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
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
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
Changes by Yury Selivanov :
Removed file: http://bugs.python.org/file33836/sig_func_ducktype_03.patch
___
Python tracker
<http://bugs.python.org/issue17159>
___
___
Pytho
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
Yury Selivanov added the comment:
Not sure if we need to backport this to older python versions
--
___
Python tracker
<http://bugs.python.org/issue18801>
___
___
1701 - 1800 of 3136 matches
Mail list logo