webmaster has already heard from 4 people who cannot install it.
I sent them to the bug tracker or to python-list but they seem
not to have gone either place. Is there some guide I should be
sending them to, 'how to debug installation problems'?
Laura
see the following:
lac@smartwheels:~/junk$ echo "print ('hello there')" >string.py
lac@smartwheels:~/junk$ idle-python3.5
hello there
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.5/idlelib/run.py", line 10, in <module>
from idlelib import CallTips
File "/usr/lib/python3.5/idlelib/CallTips.py", line 16, in <module>
from idlelib.HyperParser import HyperParser
File "/usr/lib/python3.5/idlelib/HyperParser.py", line 14, in <module>
_ASCII_ID_CHARS = frozenset(string.ascii_letters + string.digits + "_")
AttributeError: module 'string' has no attribute 'ascii_letters'
IDLE then produces a popup that says:
IDLE's subprocess didn't make connection. Either IDLE can't stat a subprocess por personal firewall software is blocking the connection. <ok>
--------
I think that life would be a whole lot easier for people if instead we got
a message:
Warning: local file /u/lac/junk/string.py shadows module named string in the
Standard Library
I think that it is python exec that would have to do this -- though of
course the popup could also warn about shadowing in general, instead of
sending people on wild goose chases over their firewalls.
Would this be hard to do?
Laura
It mentions fr'...' as a formatted raw string but doesn't say anything about rf'...'. Right now, in implementing PEP 498 support in Howl (https://github.com/howl-editor/howl/pull/118 and https://github.com/howl-editor/howl/commit/1e577da89efc1c1de780634b531f6434…), I assumed both were valid. Should the PEP be more specific?
BTW, at the rate language-python is going, GitHub will get syntax highlighting for f-strings in 2050. :D
--
Sent from my Nexus 5 with K-9 Mail. Please excuse my brevity.
Laura, I think what you want should actually be more-or-less doable in IDLE.
The main routine that starts IDLE should be able to detect if it starts correctly (something unlikely to happen if a significant stdlib module is shadowed), watch for an attribute error of that form and try to determine if shadowing is the cause, and if so, reissue a saner error message.
The subprocess/firewall error is occurring because the ‘string’ problem in your example isn’t being hit right away so a few startup things already are happening. The point where we’re showing that error (as a result of a timeout) should be able to check as per the above that IDLE was able to start alright, and if not, change or ignore the timeout error.
There’ll probably be some cases (depending on exactly what gets shadowed) that may be difficult to get to work, but it should be able to handle most things.
Mark
Dear Python-Dev,
I am the author of bidict, a bidirectional map implementation for Python. A
user recently filed a bug that bidict should be a subclass of dict, so that
isinstance(mybidict, dict) would return True. I replied that the user
should instead use isinstance(mybidict, collections.abc.Mapping), which
does already return True, and is more polymorphic to boot.
But before I put the issue to bed, I want to make sure I'm correctly
understanding the intended usage of collections.abc, as well as any
relevant interfaces I'm not currently using (collections.UserDict?
__subclasshook__?), since the documentation leaves me with some doubt.
Could any collections experts on this list please confirm whether bidict is
implemented as the language intends it should be?
Some quick references:
https://bidict.readthedocs.org/en/latest/other-bidict-types.html#bidict-typ…https://github.com/jab/bidict/blob/master/bidict/_bidict.py
I would be happy to try to capture what I learn from this thread and write
up a guide for collections library authors in the future, or otherwise pay
your help forward however I can.
Thanks and best wishes.
-jab
In issue 25483 I'm adding an opcode to make f-string formatting more
robust and faster. As part of that, I'm bumping the .pyc magic number.
While doing that, I notice Lib/importlib/_bootstrap_external.h includes
this comment:
# Starting with the adoption of PEP 3147 in Python 3.2, every bump in magic
# number also includes a new "magic tag", i.e. a human readable string used
# to represent the magic number in __pycache__ directories. When you change
# the magic number, you must also set a new unique magic tag. Generally
this
# can be named after the Python major version of the magic number bump, but
# it can really be anything, as long as it's different than anything else
# that's come before. The tags are included in the following table,
starting
# with Python 3.2a0.
The "following table" is a comment, that contains a few references to
the tag "cpython-<version>", specifically cpython-32. It doesn't seem
that the tag is routinely updated in the comment.
sys.implementation.cache_tag returns 'cpython-36', and is in fact
implemented as 'cpython-{PY_MAJOR_VERSION}{PY_MINOR_VERSION}'.
Do I need to do anything else? Unlike what the comment in
_boostrap_external.py suggests, this "magic tag" will not change every
time a bytecode is added, but only on every minor release. Which implies
that if we have a micro release that adds an opcode, we'll in fact break
the promise in the comment.
>From my understanding on how this tag is used, this wouldn't be a
problem (because the magic number in the file also changes). But I want
to make sure I'm not misunderstanding something. I think the comment
above is probably just misleading.
Eric.
On 10/23/2015 4:23 AM, Victor Stinner wrote:
> Hi,
>
> 2015-10-22 19:02 GMT+02:00 Brett Cannon <brett(a)python.org>:
>> It's not specified anywhere; it's just what the peepholer decides to remove.
>> The exact code can be found at
>> https://hg.python.org/cpython/file/default/Python/peephole.c . There has
>> been talk in the past for adding a -X flag to disable the peepholer, but it
>> never went any farther beyond that.
>
> Yeah, I remember that I had the same issue than Stéphane when I worked
> on my astoptimizer project :-) I wanted to completly disable the
> peephole optimizer because I wanted to reimplement the optimizations
> on the AST instead of rewriting the bytecode.
>
> I would be nice to have a "-X noopt" command line option for that.
How about -x nopeep to specifically skip the peephole optimizer?
--
Terry Jan Reedy
Thanks to Nick Coghlan and Barry Warsaw we've setup a new SIG dedicated
to discussing python features from different distributions point of view.
Here is Nick's reasoning:
> With the Python 3 migration, and the growth in interest in user level
> package management for development purposes, what do you think of the idea
> of setting up a new Linux SIG to have those discussions? I know it's a
case
> of "yet another mailing list", but I think it will be worthwhile to have a
> clear point of collaboration within the Python ecosystem, rather than
> expecting Pythonistas to know how to reach out to (other) distros
directly.
The list is available @ https://mail.python.org/mailman/listinfo/linux-sig
Maciej