Franklin? Lee added the comment:
Petter S reported the issue to Microsoft, and got the response that it was
already fixed in Insider Preview.
https://github.com/microsoft/WSL/issues/3514
Should be fixed in Windows 10 version 1809, according to the tags here:
https://github.com/microsoft/WSL
Franklin? Lee added the comment:
> > It's likely also false that every entry will be checked, since presumably
> > the function uses short-circuit logic.
> This, however, would be good to verify first.
Verified.
https://github.com/python/cpython/blob/36dcaab7fde5d2e54cde
Franklin? Lee added the comment:
My mistake. I selected all versions after checking issubclass for 2.7 and
several 3.x, but added the isinstance notes later without paying attention to
versions.
I copied the isinstance text from 3.2 docs. As you said, it's not the current
New submission from Franklin? Lee :
isinstance:
> If classinfo is not a class (type object), it may be a tuple of type objects,
> or may recursively contain other such tuples (other sequence types are not
> accepted).
issubclass:
> classinfo may be a tuple of class objects, i
New submission from Franklin? Lee :
The following line should have a character that trips up the compiler.
‎indices = range(5)
The character is \u200e, and was inserted by Google Keep. (I've already
reported the issue to Google as a regression.)
Here's the error message:
"&qu
Franklin? Lee added the comment:
BIKESHEDDING
Here is another concern with decorators and `.__module__` (or
`inspect.getmodule`). (Or is it the original concern?)
If an earlier decorator creates a wrapper and doesn't set .__module__, you'll
make the function public in the wr
Franklin? Lee added the comment:
I probably won't submit a patch, but I can definitely write a bunch of private
notes toward a patch and forget about them. >_>
Idea 1: Crawl up the call tree and see whether you hit a module definition or a
class definition first.
Idea 2: Inspect _
Franklin? Lee added the comment:
> What you're looking for is in the 2nd paragraph of the ast docs:
Oh. I considered that, but then compile's docs say:
The optional arguments flags and dont_inherit
control which future statements (see PEP 236)
affect the compilat
Franklin? Lee added the comment:
>>If @public were only to be used as a decorator, it would not be possible to
>>have `public` called on a function outside of its definition. But someone
>>might call `public(some_decorator(some_function))`.
>
>Do you mean, they'd c
New submission from Franklin? Lee:
>From `compile`'s doc:
"Compile the source into a code or AST object."
The docs don't say how to compile into an AST object with `compile`, though. As
it says later:
"If you want to parse Python code into its AST represent
Franklin? Lee added the comment:
>I don't know, but what practical effect will this have? I.e. under what
>conditions would you @public wrap a @functools.wraps function and want it to
>show up in __all__? Do you have a specific use case?
I sometimes wrap functions that retur
Franklin? Lee added the comment:
I like how ``@public`` keeps the declaration close to the definition.
I am iffy about using ``public`` to define other values. That part might be
considered unpythonic.
Implementation issues:
- ``__module__`` is not reliable. ``functools.wraps`` changes
New submission from Franklin? Lee:
`inspect`'s names are pretty close to unique, except for `stack`, `unwrap`, and
`trace`. It doesn't define `__all__`, though.
--
components: Library (Lib)
messages: 265893
nosy: leewz
priority: normal
severity: normal
status: open
title
Franklin? Lee added the comment:
In that case, I'm still wondering what you mean by "not equivalent". Are you
saying there is code which will work only if the ``bool`` function is really
called?
--
___
Python tracker
<http
Franklin? Lee added the comment:
> Although I still think it's telling readers incorrect info in the second
> part. For ``bool``, it is not equivalent to ``(item for item in iterable if
> function(item))`` but ``(item for item in iterable if item)``. For CPython,
> you ar
Franklin? Lee added the comment:
Aren't these both implementation details? As in, they only affect efficiency,
not effect, right?
--
nosy: +leewz
___
Python tracker
<http://bugs.python.org/is
16 matches
Mail list logo