[issue36287] Make ast.dump() not output optional default fields

2020-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18200
pull_request: https://github.com/python/cpython/pull/18843

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18199
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18842

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39900] `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.__bytes__()` calls `os.fsencode()` without using path's accessor. 
To properly isolate Path objects from the underlying local filesystem, this 
should be routed via the accessor object.

--
messages: 363638
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.__bytes__()` calls `os.fsencode()` without using accessor

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18198
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18841

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-07 Thread Barney Gale


Barney Gale  added the comment:

We can check whether `os.path.expanduser()` returned a path beginning with "~" 
and raise a RuntimeError if so, right? On point #2, I'm not sure this 
optimization alone justifies the duplication. PR incoming...

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are two reasons:

1. os.path.expanduser() returns the path unchanged when a home directory cannot 
be resolved, pathlib.Path.expanduser() raises an error. The latter behavior 
looks more robust, but we can't change os.path.expanduser().

2. os.path.expanduser() needs to split the path on components while 
pathlib.Path.expanduser() already has ready components. In some cases it may be 
more efficient.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39899] `pathlib.Path.expanduser()` does not call `os.path.expanduser()`

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.expanduser()` does not call `os.path.expanduser()`, but instead 
re-implements it. The implementations look pretty similar and I can't see a 
good reason for the duplication. The only difference is that 
`pathlib.Path.expanduser()` raises `RuntimeError` when a home directory cannot 
be resolved, whereas `os.path.expanduser()` returns the path unchanged.

--
components: Library (Lib)
messages: 363635
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.expanduser()` does not call `os.path.expanduser()`
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18196
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18839

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c

2020-03-07 Thread Andy Lester


Change by Andy Lester :


--
keywords: +patch
pull_requests: +18197
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18840

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39898] Remove unused arg from append_formattedvalue in Python/ast_unparse.c

2020-03-07 Thread Andy Lester


New submission from Andy Lester :

append_formattedvalue() has an unused bool is_format_spec.

--
components: Interpreter Core
messages: 363634
nosy: petdance
priority: normal
severity: normal
status: open
title: Remove unused arg from append_formattedvalue in Python/ast_unparse.c

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39897] `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore misbehaves in `Path` subclasses

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path.is_mount()` calls `Path(self.parent)`, which:

- Is needless, as `self.parent` is already a Path instance!
- Prevents effective subclassing, as `self.parent` may be a `Path` subclass 
with its own `stat()` implementation

--
components: Library (Lib)
messages: 363633
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.is_mount()` calls `Path(self.parent)` and therefore 
misbehaves in `Path` subclasses
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18195
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18838

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester


Change by Andy Lester :


--
keywords: +patch
pull_requests: +18194
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18837

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39896] Const args and remove unused args in Python/compile.c

2020-03-07 Thread Andy Lester


New submission from Andy Lester :

Remove unused args from:
* binop
* compiler_next_instr
* inplace_binop

Const arguments for:
* assemble_jump_offsets
* blocksize
* check_caller
* check_compare
* check_index
* check_is_arg
* check_subscripter
* compiler_error
* compiler_new_block
* compiler_pop_fblock
* compiler_push_fblock
* compiler_warn
* compute_code_flags
* dfs
* find_ann
* get_ref_type
* merge_const_tuple
* stackdepth

--
components: Interpreter Core
messages: 363632
nosy: petdance
priority: normal
severity: normal
status: open
title: Const args and remove unused args in Python/compile.c

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39895] `pathlib.Path.touch()` calls `os.close()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`Path.touch()` does a lot of os-specific /stuff/ that should probably live in 
the accessor. Perhaps most importantly, is calls `os.close()` on whatever 
`accessor.open()` returns, which is problematic for those wishing to write 
their own accessor that doesn't work on a file descriptor level.

--
components: Library (Lib)
messages: 363631
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.touch()` calls `os.close()` without using accessor
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18193
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18836

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39791] New `files()` api from importlib_resources.

2020-03-07 Thread Ben Thayer


Change by Ben Thayer :


--
nosy: +benthayer

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39894] `pathlib.Path.samefile()` calls `os.stat()` without using accessor

2020-03-07 Thread Barney Gale


New submission from Barney Gale :

`Path.samefile()` calls `os.stat()` directly. It should use the path's accessor 
object, as `Path.stat()` does.

--
components: Library (Lib)
messages: 363629
nosy: barneygale
priority: normal
severity: normal
status: open
title: `pathlib.Path.samefile()` calls `os.stat()` without using accessor
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d5aa2e941ccc44412b95d0e3f0a1789fbcccf403 by Brandt Bucher in 
branch 'master':
bpo-39890: Don't mutate the AST when compiling starred assignments (GH-18833)
https://github.com/python/cpython/commit/d5aa2e941ccc44412b95d0e3f0a1789fbcccf403


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the great catch, Brandt!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Ah, I didn't realize that os.environ and os.environ b aren't dict subclasses. 
I've added a ticket to update them with the new operators!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39837] Remove Azure Pipelines from GitHub PRs

2020-03-07 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +18192
pull_request: https://github.com/python/cpython/pull/18835

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-07 Thread Tim Peters


Tim Peters  added the comment:

If you pursue this, please introduce a new function for it.  You immediately 
have an idea about how to change the current function precisely because it 
_doesn't_ try to guess what you really wanted.  That lack of magic is valuable 
- you're not actually confused by what it does, because it doesn't do anything 
to the strings you give it ;-)  By the same token, if you have a crisp idea of 
how it should treat strings instead, it's straightforward to write a wrapper 
that does so.  The existing function won't fight you by trying to impose its 
own ideas.

Guessing what people really wanted tends to become a bottomless pit.  For 
example, do you know all the rules for what "case" even means in a Unicode 
world?  What about diacritical marks?  And so on.  I don't.

Not saying it shouldn't be pursued.  Am saying it may be hard to reach 
consensus on what's "really" wanted.  By some people, some of the time.  Never 
- alas - by all people all the time.

--
nosy: +tim.peters
stage:  -> needs patch
type:  -> enhancement
versions: +Python 3.9 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Issue 39857 just reminded me that we should update os._Environ as well (the 
type of os.environ and os.environb).

I have another first-timer who will probably want to take it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

Caleb's answer, using PEP 584's merge operator:

newenv = os.environ | {'FOO': ..., 'BAR': ...}
subprocess.run(..., env=new_env, ...)

--
nosy: +brandtbucher

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39659] pathlib calls `os.getcwd()` without using accessor

2020-03-07 Thread Barney Gale


Change by Barney Gale :


--
keywords: +patch
pull_requests: +18191
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18834

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39768] remove tempfile.mktemp()

2020-03-07 Thread wyz23x2


Change by wyz23x2 :


--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39893] Add set_terminate() to logging

2020-03-07 Thread wyz23x2


wyz23x2  added the comment:

typo: "with something else", not "wit something else". Sorry for that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39893] Add set_terminate() to logging

2020-03-07 Thread wyz23x2


New submission from wyz23x2 :

Sometimes, we want to remove the ending \n and sometimes replace it wit 
something else, like print(). But logging doesn't support that.
I'd want a set_terminate() (Or set_end()) function that does that. I think it's 
easy. Just insert this at line 1119 of __init__ of 3.8.2:
def set_terminator(string='\n'):
StreamHandler.terminator = string
Thanks!

--
components: Library (Lib)
messages: 363622
nosy: wyz23x2
priority: normal
severity: normal
status: open
title: Add set_terminate() to logging
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39857] subprocess.run: add an extra_env kwarg to complement existing env kwarg

2020-03-07 Thread Caleb Hattingh


Caleb Hattingh  added the comment:

dict syntax tools make it fairy easy to compose new dicts from old ones with 
overrides:

subprocess.run(..., env={**os.environ, 'FOO': ..., 'BAR', ...}, ...)

Would this be sufficient to avoid the copy/pasting boilerplate?

--
nosy: +cjrh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39812] Avoid daemon threads in concurrent.futures

2020-03-07 Thread Kyle Stanley


Change by Kyle Stanley :


--
assignee:  -> aeros

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39892] Enable DeprecationWarnings by default when not explicit in unittest.main()

2020-03-07 Thread Gregory P. Smith


New submission from Gregory P. Smith :

Recurring theme: The stdlib has the issue of DeprecationWarning being added to 
APIs we are changing or removing a few versions in the future yet we perceive 
that many people never actually bother to try checking their code for 
deprecation warnings.  Only raising issues with a documented, warned, planned 
in advance API change when it actually happens.

Could we reduce the chances of this by enabling DeprecationWarnings by default 
for processes started via unittest.main() and other common unittest 
entrypoints?  (other test frameworks like pytest should also consider this if 
they don't already; do we have any existing external implementations of this 
for inspiration?)

One issue with this is that some important warnings are at _parse_ time or 
_import_ time.  But we can deal with import time ones if we are able to have 
the unittest entrypoint re-exec the process with the same args but with 
warnings enabled.  (and _could_ surface parse time ones if we're willing to 
accept slower process startup by disabling use of pycs; i wouldn't go that far)

Related work: https://www.python.org/dev/peps/pep-0565/

has this idea already been discussed?  I don't remember and haven't searched 
backwards...

--
components: Library (Lib), Tests
messages: 363620
nosy: gregory.p.smith, ncoghlan, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Enable DeprecationWarnings by default when not explicit in 
unittest.main()
type: enhancement
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39812] Avoid daemon threads in concurrent.futures

2020-03-07 Thread Kyle Stanley


Kyle Stanley  added the comment:

I spent some further time considering the solution to the problem, and I still 
think something like a `threading.register_atexit()` (see 
https://bugs.python.org/issue37266#msg362960) would be the most suitable.

However, I'm not certain regarding the exact details. The simplest pure Python 
implementation I can think of would be through a global list in 
`Lib/threading.py`, which is only initialized when 
`threading.register_atexit()` is called for the first time (to avoid unneeded 
overhead when threading exit functions aren't needed). In order to preserve 
keyword arguments, each registered function would be appended to the list as a 
partial. Then, in the private `_shutdown()`, each registered atexit function is 
called just after the main thread is finished, but just before the non-daemon 
threads are joined:

```
_threading_atexits = None

def register_atexit(func, *args, **kwargs):
global _threading_atexits
if _threading_atexits is None:
_threading_atexits = []
call = functools.partial(func, *args, **kwargs)
_threading_atexits.append(call)

# [snip]

def _shutdown():
if _main_thread._is_stopped:
# _shutdown() was already called
return

# Main thread
tlock = _main_thread._tstate_lock
# The main thread isn't finished yet, so its thread state lock can't have
# been released.
assert tlock is not None
assert tlock.locked()
tlock.release()
_main_thread._stop()

# Call registered threading atexit functions
for atexit_call in _threading_atexits:
atexit_call()

# Join all non-deamon threads
# [snip]
```

Could something like the above pure Python implementation be adequate for our 
purposes? It seems like it would be to me, but I could very well be missing 
something. I'll of course have to test if it works as intended for replacing 
the daemon threads in concurrent.futures.

Another factor to consider is whether or not something like this would be 
widely useful enough to consider adding `threading.register_atexit()` to the 
public API for the threading module, or if it should just be an internal 
_function with a docstring. I could see it being useful in similar cases where 
daemon threads are no longer a viable option (due to subinterepter 
compatibility or any other reason). But, I suspect the demand for it won't be 
overly high from users until PEP 554 is completed.

Thoughts?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39890] The AST is mangled when compiling starred assignments

2020-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
title: The AST is mangled when compiling starred assignments. -> The AST is 
mangled when compiling starred assignments

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39891] [difflib] Improve get_close_matches() to better match when casing of words are different

2020-03-07 Thread brian.gallagher


New submission from brian.gallagher :

Currently difflib's get_close_matches() doesn't match similar words that differ 
in their casing very well.

Example:
user@host:~$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import difflib
>>> difflib.get_close_matches("apple", "APPLE")
[]
>>> difflib.get_close_matches("apple", "APpLe")
[]
>>>

These seem like they should be considered close matches for each other, given 
the SequenceMatcher used in difflib.py attempts to produce a "human-friendly 
diff" of two words in order to yield "intuitive difference reports".

One solution would be for the user of the function to perform their own 
transformation of the supplied data, such as converting all strings to 
lower-case for example. However, it seems like this might be a surprise to a 
user of the function if they weren't aware of this limitation. It would be 
preferable to provide this functionality by default in my eyes.

If this is an issue the relevant maintainer(s) consider worth pursuing, I'd 
love to try my hand at preparing a patch for this.

--
messages: 363618
nosy: brian.gallagher
priority: normal
severity: normal
status: open
title: [difflib] Improve get_close_matches() to better match when casing of 
words are different
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: The Real-Time Use of Python in Data Science World!

2020-03-07 Thread Gene Heskett
On Saturday 07 March 2020 16:23:58 Perri Jones wrote:

> Is this training that someone can sign up for, and if so, how do you
> sign up.
This could be legit, but it sure smells like spam to me, so please meet 
sa-learn spam>
> 
> From: priyasudha041...@gmail.com 
> Sent: Saturday, March 7, 2020 12:39 AM
> To: python-announce-l...@python.org 
> Subject: Re: The Real-Time Use of Python in Data Science World!
>
> Besant Technologies providing Python Training in Chennai with expert
> guidance and fully hands-on classes. Python is a high-level
> programming language sometimes it also denoted as the scripting
> language as it provides rapid & fast development and easy of use. Our
> Python Training in Chennai package also includes job placement
> assistance, which is really a bonus point for students. We also help
> students in getting a good job by conducting interviews of ours with
> good IT companies and MNCs too.
>
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
>besanttechnologies.com%2Ftraining-courses%2Fpython-training-institute-i
>n-chennaidata=02%7C01%7C%7Ca4d13696dfe649b76ba308d7c25dd7c2%7C84df
>9e7fe9f640afb435%7C1%7C0%7C637191580609217361sdata=lRZ
>ZiFR6AWxUBu7r90lXNZNlITNSji80S%2Bp%2FVWRWbi8%3Dreserved=0 --
> Python-announce-list mailing list -- python-announce-l...@python.org
> To unsubscribe send an email to python-announce-list-le...@python.org
> https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail
>.python.org%2Fmailman3%2Flists%2Fpython-announce-list.python.org%2F
>;data=02%7C01%7C%7Ca4d13696dfe649b76ba308d7c25dd7c2%7C84df9e7fe9f640afb
>435%7C1%7C0%7C637191580609217361sdata=%2FGx3A6KvX6%2FN
>Ru2mkOwPty9n3Y8Z1tCX0Lmv1Ov1LcI%3Dreserved=0
>
> Support the Python Software Foundation:
>
> https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.p
>ython.org%2Fpsf%2Fdonations%2Fdata=02%7C01%7C%7Ca4d13696dfe649b76b
>a308d7c25dd7c2%7C84df9e7fe9f640afb435%7C1%7C0%7C63719158060
>9217361sdata=iEYALDe6NXEt%2BzW9g%2BW4zqLQEJq9kxMPXTFl8nyeg3Q%3D
>p;reserved=0


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39868] Stale Python Language Reference docs (no walrus).

2020-03-07 Thread Brandt Bucher


Brandt Bucher  added the comment:

> I have created my draft with an example but I am confused about where exactly 
> do I have to add the code and push it.

> I have cloned these two repositories in my system and setup everything:
> https://github.com/python/cpython
> https://github.com/python/devguide

Great! It's not necessary to clone the devguide though; CPython is the only one 
you're going to edit.

Make sure you've "forked" the repo on GitHub, and are working on a local clone 
of your fork. Otherwise things will be trickier.

> 1. Please tell me where I should be adding my code. Do I have to add code 
> here 
> https://github.com/python/cpython/blob/master/Doc/reference/expressions.rst 
> and push it?

Yes, you'll add the new documentation to line 1652, where the "TODO" comment 
is. You should make the changes in your own fork of the repo, and push. Then 
you'll be ready for a PR.

> 2. I am working on the master branch only. Is there any specific branch I 
> have to select?

Working from master in your own fork is fine, but frequent contributors often 
prefer to branch from master and work on those branches instead.

The pages I've linked to in the devguide walk you through every step of making 
a PR (including an intro on how to use Git). If it's easier for you, though, 
you can attach a copy of your edits to this issue and I can make a PR on your 
behalf. I just wouldn't count on repeating that workflow if you plan on 
contributing in the future; regular contributors should feel comfortable 
branching, committing, opening a PR, etc.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: The Real-Time Use of Python in Data Science World!

2020-03-07 Thread Perri Jones
Is this training that someone can sign up for, and if so, how do you sign up.


From: priyasudha041...@gmail.com 
Sent: Saturday, March 7, 2020 12:39 AM
To: python-announce-l...@python.org 
Subject: Re: The Real-Time Use of Python in Data Science World!

Besant Technologies providing Python Training in Chennai with expert guidance 
and fully hands-on classes. Python is a high-level programming language 
sometimes it also denoted as the scripting language as it provides rapid & fast 
development and easy of use. Our Python Training in Chennai package also 
includes job placement assistance, which is really a bonus point for students. 
We also help students in getting a good job by conducting interviews of ours 
with good IT companies and MNCs too.

https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.besanttechnologies.com%2Ftraining-courses%2Fpython-training-institute-in-chennaidata=02%7C01%7C%7Ca4d13696dfe649b76ba308d7c25dd7c2%7C84df9e7fe9f640afb435%7C1%7C0%7C637191580609217361sdata=lRZZiFR6AWxUBu7r90lXNZNlITNSji80S%2Bp%2FVWRWbi8%3Dreserved=0
--
Python-announce-list mailing list -- python-announce-l...@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman3%2Flists%2Fpython-announce-list.python.org%2Fdata=02%7C01%7C%7Ca4d13696dfe649b76ba308d7c25dd7c2%7C84df9e7fe9f640afb435%7C1%7C0%7C637191580609217361sdata=%2FGx3A6KvX6%2FNRu2mkOwPty9n3Y8Z1tCX0Lmv1Ov1LcI%3Dreserved=0

Support the Python Software Foundation:

https://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.python.org%2Fpsf%2Fdonations%2Fdata=02%7C01%7C%7Ca4d13696dfe649b76ba308d7c25dd7c2%7C84df9e7fe9f640afb435%7C1%7C0%7C637191580609217361sdata=iEYALDe6NXEt%2BzW9g%2BW4zqLQEJq9kxMPXTFl8nyeg3Q%3Dreserved=0
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39890] The AST is mangled when compiling starred assignments.

2020-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +18190
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18833

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39890] The AST is mangled when compiling starred assignments.

2020-03-07 Thread Brandt Bucher


New submission from Brandt Bucher :

It looks like assignment_helper is the only place where we actually change the 
semantic meaning of the AST during compilation (a starred name is changed to a 
regular name as a shortcut).

This probably isn't a great idea, and it would bite us later if we started 
making multiple passes or reusing the AST or something.

--
assignee: brandtbucher
components: Interpreter Core
messages: 363616
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: The AST is mangled when compiling starred assignments.
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39844] IDLE 3.8.2 on MacOS 10.15.3 Launches to Black Windows

2020-03-07 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the pythoninfo output. I didn't see anything unusual there. So I 
remain perplexed. The thing is the macOS Tk 8.6.8 we supply with current 
python.org installers doesn't support Dark Mode at all, AFAIK.  That was added 
in 8.6.9.  I normally have macOS Dark Mode enabled on all of macOS systems, 
both real and virtual and, with the python.org Tk 8.6.8, Tk windows are always 
in Light mode, including on 10.15.3, regardless of the settings in System 
Preferences -> General.  I do have at hand a MacPorts Python 3.8.2 that uses a 
MacPorts-supplied Tk 8.6.10; in that case, the Tk windows do follow the System 
Preferences Dark Mode preference and IDLE's Preference windows looks fine as 
one would expect it to in Dark mode. (Unfortunately, there are other problems 
with IDLE using Tk 8.6.10 that need to be resolved before we can move to it.)

There is this relevant discussion in the Apple Developer documentation:

https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app?language=objc

Since the python.org macOS Pythons are built with a pre-10.14 SDK, they should 
be automatically opted out of Dark mode unless you add the 
NSRequiresAquaSystemAppearance key to the app bundle plist of IDLE.app or 
Python.app. And that is consistent with the behavior I observe. I verified 
that, by modifying the python.org IDLE.app plist to include a key 
NSRequiresAquaSystemAppearance with value NO, IDLE's Tk windows are displayed 
in Dark mode with the text windows completely dark as in your screen shots.  So 
... assuming we aren't missing something somewhere and you are not really 
executing the python.org supplied Python / IDLE when you see this behavior, my 
only guess at this point is that you have some extension or some system 
variable set that overrides this automatic opt-out of dark mode for older apps.

There is also some discussion in various forums of a system-wide preference, 
NSRequiresAquaSystemAppearance, that could be used in macOS Mojave to force 
dark mode.  I tried playing with it on both 10.14 and 10.15 and saw no change 
in (unmodified) IDLE.app Tk behavior but perhaps I'm missing something.

Maybe all this rings a bell or two for you about customizations you might have 
made on your system?  Otherwise, I don't know what else to suggest at this 
point.  I guess you *could* try tweaking the IDLE.app plist to explicitly 
disable the dark mode opt-in and see if that makes a difference but, of course, 
that wouldn't find the root cause.  And the other thing would be to try running 
the python.org in a vanilla 10.15 environment, perhaps in a Fusion VM.

I'm going to close this bug report since it seems unlikely to be a Python or 
even Tk 8.6.8 issue.  But feel free to update or re-open if you find more 
information.  Good luck!

--
resolution:  -> works for me
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Richard Damon
On 3/7/20 5:15 AM, Νίκος Βέργος wrote:
> When superhost.gr/test tries to post html form data to the route endpoint 
> '/mailform' it sends it to superhost.gr/mailform and NOT at 
> superhost.gr/test/mailform as it should have done.
>
The HTML path /mailform means server relative path, so the path is
relative to the SERVER, not the current page, so it would be
superhost.gr/mailform

The other format goes through a function which might re-interpret the
path and either make it page relative or add in the path of the current
page to get to /test/mailform


-- 
Richard Damon

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39832] Modules with decomposable characters in module name not found on macOS

2020-03-07 Thread Ned Deily


Ned Deily  added the comment:

This seems like more an import issue than a uniquely macOS issue. Also, a quick 
search found Issue10952 which appears to be similar.

--
nosy: +brett.cannon, vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Curtis Bucher


Change by Curtis Bucher :


--
nosy: +curtisbucher
nosy_count: 11.0 -> 12.0
pull_requests: +18189
pull_request: https://github.com/python/cpython/pull/18832

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators

2020-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
You will see if you create a route endpoint called 'mailform' within '/' which 
is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' 
when the latter tries to post data to '/mailform' instead of sending them to
'superhost.gr/test/' it sends them to '/' which is 'superhost.gr'
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using zipfile to create a zip file with directories and files

2020-03-07 Thread Michael Torrie
On 3/7/20 1:08 AM, mus...@posteo.org wrote:
> On Fri, 6 Mar 2020 20:06:40 -0700
> Michael Torrie  wrote:
>
>> The documentation talks about writing files from
>> disk, but I'm interested in creating these files from within Python
>> directly in the zip archive.
>
> But you have seen writestr(), haven't you?

Yes, that's what I was using.  Turns out I didn't look closely enough at the 
exception I was getting.  What i thought was zipfile complaining about a '/' 
character was really Python complaining about a bad string formatting string I 
was using!

Thanks for confirming that zipfile indeed should work the way I hoped it wood. 
I'm in business now.

thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
Τη Σάββατο, 7 Μαρτίου 2020 - 9:00:41 μ.μ. UTC+2, ο χρήστης DL Neil έγραψε:
> On 7/03/20 2:33 AM, îØî-îºî¿ïé îÆî ïüî³î¿ïé wrote:
> > First i must say i use Bottle, but the same may also be the case in Flask
> too. I ask here and not in sub Bottle because there are only a few people 
> there and i receive no responses.
> >
> > Actualy since i started here let me say what i have found.
> >
> > Iam just trying to post html form data to the following endpoint.
> >
> > @app.route( '/mailform', method=['POST'] )
> > IF i try to post the html form data using the the endpoint url way, i get
> "Method NOT Allowed" error:
> >
> > 
> >
> >
> > WHILE if i try the following way, i receive no error.
> >
> >  ...html...  ''' % app.get_url(
> '/mailform )
> >
> > Can someone explain why?!
> 
> 
> Please post the full error message and traceback.
> 
> To clarify: is the error coming from Python or from the web server?
> 
> --
> Regards =dn

Sorry, the requested URL 'http://superhost.gr/mailform' caused an error:

Internal Server Error
Exception:
TypeError("argument of type 'NoneType' is not iterable",)
Traceback:
Traceback (most recent call last):
  File "/home/nikos/wsgi/bottle.py", line 996, in _handle
out = route.call(**args)
  File "/home/nikos/wsgi/bottle.py", line 2007, in wrapper
rv = callback(*a, **ka)
  File "/home/nikos/wsgi/www.py", line 189, in mailform
if provider in FROM:
TypeError: argument of type 'NoneType' is not iterable
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Using zipfile to create a zip file with directories and files

2020-03-07 Thread musbur
On Fri, 6 Mar 2020 20:06:40 -0700
Michael Torrie  wrote:

> The documentation talks about writing files from
> disk, but I'm interested in creating these files from within Python
> directly in the zip archive.

But you have seen writestr(), haven't you?

ZipFile.writestr(zinfo_or_arcname, data, compress_type=None, compresslevel=None)

Write a file into the archive. The contents is data, which may be
either a str or a bytes instance;

> So I naively thought I could use the "open"
> method of zipfile, giving it a relative path describing the relative
> path and file name that I want to then write bytes to.  But seems I am
> mistaken.

No your're not. writestr() and ZipInfo are your friends, unless I haven't 
understood what you're trying to do.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
î¤î· î£î¬î²î²î±ïäî¿, 7 î£î±ïüïäî-î¿ïà 2020 - 12:34:21 ï .î¼. UTC+2, î¿
ïçïüîRïâïäî·ïé DL Neil î î³ïüî±ïêîµ:

> Please post the full error message and traceback.
>
> To clarify: is the error coming from Python or from the web server?


I beleive it comes from the web server. Here it is:

Error: 500 Internal Server Error
Sorry, the requested URL 'http://superhost.gr/mailform' caused an error:

Internal Server Error
Exception:
TypeError("argument of type 'NoneType' is not iterable",) Traceback:
Traceback (most recent call last):
  File "/home/nikos/wsgi/bottle.py", line 996, in _handle
out = route.call(**args)
  File "/home/nikos/wsgi/bottle.py", line 2007, in wrapper
rv = callback(*a, **ka)
  File "/home/nikos/wsgi/www.py", line 189, in mailform
if provider in FROM:
TypeError: argument of type 'NoneType' is not iterable


I somehow beleive that the following apache conf directives somehow create 
problem.

When superhost.gr/test tries to post html form data to the route endpoint
'/mailform' it sends it to superhost.gr/mailform and NOT at
superhost.gr/test/mailform as it should have done.

They somehow interfere.

Here is the processes running in the webserver that somehow interfere.


WSGIDaemonProcess test user=nikos group=nikos home=/home/nikos/wsgi
WSGIScriptAlias /test /home/nikos/wsgi/test.py process-group=test
application-group=%{GLOBAL}

WSGIDaemonProcess www user=nikos group=nikos home=/home/nikos/wsgi
WSGIScriptAliasMatch / /home/nikos/wsgi/www.py process-group=www
application-group=%{GLOBAL}
-- 
https://mail.python.org/mailman/listinfo/python-list


pip UX Studies - help improve the usability of pip

2020-03-07 Thread Bernard Tyers - Sane UX Design
Hi there,

My name is Bernard Tyers. I'm a UX designer and have recently started working 
on the PSF project to improve the usability of pip, funded by MOSS/CZI.

I want to let you know about the pip UX Studies we've started today, and 
encourage you to sign-up and take part.

The pip Team is looking for Python users who use pip to take part in our UX 
Studies. Your input will have a direct impact on improving pip.

We want to speak with as diverse a group as possible. We'd particularly like to 
speak with people with accessibility needs.

You _don't_ have to be a Python expert to take part - I can't stress this 
enough!

You can find out all the details you'll need and find the sign-up link on this 
blogpost:

http://www.ei8fdb.org/thoughts/2020/03/pip-ux-study-recruitment/

If you do have questions I've not answered there, let me know.

We'd also appreciate some signal boosting to reach as wide an audience as 
possible. Please share the blog post with people in different Python using 
communities.

If you're a Twitter/Mastodon user we'd appreciate a signal boost of these also:

https://twitter.com/bernardtyers/status/123603961730017
https://social.ei8fdb.org/@bernard/103778645553767728


Thank you for your attention!

Best wishes,

Bernard
--

Bernard Tyers, User research & Interaction Design

T: @bernardtyers
M: @bern...@social.ei8fdb.org
PGP Key: keybase.io/ei8fdb


I work on User-Centred Design, Open Source Software and Privacy.
-- 
https://mail.python.org/mailman/listinfo/python-list


Is there something similar to guidechimp in python?

2020-03-07 Thread Souvik Dutta
This is guidechimp -https://github.com/Labs64/GuideChimp Is there anything 
similar to this in python?
-- 
https://mail.python.org/mailman/listinfo/python-list


Using zipfile to create a zip file with directories and files inside

2020-03-07 Thread Michael Torrie
I am trying to do something very simple but having no success in finding out 
how to do it. I just want to use the Python zipfile module to create a zip file 
with a specific directory structure and create and write to files inside those 
subdirectories (not files already on disk).  The documentation talks about 
writing files from disk, but I'm interested in creating these files from within 
Python directly in the zip archive. I've read over the docs several times but 
nothing speaks to this, and none of the examples I've searched for show this 
either.

I thought that in zip files, directories are really just part of the name of 
the file, and if unless you tell unzip not to, it creates them as files are 
extracted. So I naively thought I could use the "open" method of zipfile, 
giving it a relative path describing the relative path and file name that I 
want to then write bytes to.  But seems I am mistaken.  Is this a limitation of 
the zip format that cannot allow that sort of thing?  Must I resort to 
temporary files?

Plenty of examples on how to create an archive from existing files and 
directories on disk of course, which isn't what I want to do.
-- 
https://mail.python.org/mailman/listinfo/python-list


Python question

2020-03-07 Thread Mr . Lee Chiffre
Thank you Marco for at least taking the time to read my message even if you do 
not agree with me on things. And no disrespect to you. But I came here for 
python related questions and help. Not to be called suspicious and 
untrustworthy only because I am concerned about security of users and for being 
a advocate of privacy. Then to call for me to be censored is just ludicrous.


> People of Python List, I strongly discourage you to support this user.
> He is quite suspicious for the following reasons:
>
> 1. he go so far as he offers money for, IMHO, a trivial task

I said I am a python noob. This is why I asked for help. And I see no issue in 
offering payment for a programming task.

> 2. he does not trust binaries from pip.

What is the point of open source if you cannot compile from source code?

> code. A lack of trust in open source projects that is quite unusual
> 3. I don't trust any cryptocurrency.

Not unusual. People use open source because they dont trust closed source. 
Binaries that someone else compiled is not open source.

> I believe in privacy,  but not in financial privacy. Yes,
> cryptocurrencies can be useful for circumvent bans from tyrannic
> states. But they can, and _are_ used, primarily to:
>  - wash dirty money, by criminals and mafias
>  - evade taxes
>  - buy highly unethical "products", like weapons... and who know what
> other
>  - finance tyrannies.

Roads and cars are used by drug dealers. Stop using roads and cars. Cash is 
used by criminals. Stop using cash. Internet is used by child abusers. Stop 
supporting the internet. I am offended that you group me with criminals and 
baddies because I support technological privacy.


>
> I do _not_ think that all people that uses cryptocurrencies are
> criminals. I had, for example, some co-workers that invested in
> BitCoins, only for profit.
>
> But I do not trust this man, and I hope no one will offer support to
> him. By my side, I'll report this discussion to moderators.

That is fine if you dont like something. You dont have to help me out if you 
dont want to. But trying to censor me is unethical. Hopefully other people will 
have the logic to make decisions for themselves and give me help on python if 
they choose to do so.

I hope my reply does not get censored. I am being reasonable here. And if you 
are wondering why I am "paranoid", you would be too if you are dealing with a 
server that might host a hot wallet. I dont want my server getting hacked just 
because I was too lazy to compile my own code. And it is not uncommon for 
binaries of open source projects to be injected with malware.
-- 
https://mail.python.org/mailman/listinfo/python-list


iterate through an irregular nested list in Python

2020-03-07 Thread sinndhhu
Hi All,
I am new to python.
I have a irregular nested lists in a list. Please help me to iterate through 
each element.

Thanks much in advance.

Sample Ex

aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]

expected output:
2,jkj,,,kite,88,ooo,pop,push,pull,hello
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Application setup like windows msi

2020-03-07 Thread Christian Gollwitzer
Am 05.03.20 um 02:48 schrieb Michael Torrie:
> On 3/4/20 4:51 PM, J A wrote:
>> I was wondering g if there was a way to distribute an application that took
>> advantage of user input like a windows .msi does. On linux of course.
>
> Several installer frameworks can make interactive installers for Linux.
> There's the NullSoft installer and InstallerVICE.  And quite a few
> commercial packages have rolled their own installers. Although I find
> installers of any kind of annoying on Linux and don't seem all that
> necessary.
>
+1!

On Linux, the most reasonable binary distribution is a .tar.bz2 package which 
extracts a folder with a startup script. This works on every Linux distribution 
and is one of the most common ways for Firefox etc. Of course, if you can 
afford to offer several packages, the other recommended way is packages for the 
system package manager - but this means it is system-dependent - or the newer 
things like flatpak and snap. However the tarball is the thing that always 
works, even for me as a user without root access.

Christian
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread DL Neil via Python-list
On 7/03/20 2:33 AM, îØî-îºî¿ïé îÆî ïüî³î¿ïé wrote:
> First i must say i use Bottle, but the same may also be the case in Flask
too. I ask here and not in sub Bottle because there are only a few people there 
and i receive no responses.
>
> Actualy since i started here let me say what i have found.
>
> Iam just trying to post html form data to the following endpoint.
>
> @app.route( '/mailform', method=['POST'] )
> IF i try to post the html form data using the the endpoint url way, i get
"Method NOT Allowed" error:
>
> 
>
>
> WHILE if i try the following way, i receive no error.
>
>  ...html...  ''' % app.get_url(
'/mailform )
>
> Can someone explain why?!


Please post the full error message and traceback.

To clarify: is the error coming from Python or from the web server?

--
Regards =dn
-- 
https://mail.python.org/mailman/listinfo/python-list


How to POST html data to be handled by a route endpoint

2020-03-07 Thread =?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs
First i must say i use Bottle, but the same may also be the case in Flask too. 
I ask here and not in sub Bottle because there are only a few people there and 
i receive no responses.

Actualy since i started here let me say what i have found.

Iam just trying to post html form data to the following endpoint.

@app.route( '/mailform', method=['POST'] )
IF i try to post the html form data using the the endpoint url way, i get 
"Method NOT Allowed" error:




WHILE if i try the following way, i receive no error.

 ...html...  ''' % app.get_url(
'/mailform )

Can someone explain why?!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: iterate through an irregular nested list in Python

2020-03-07 Thread Pieter van Oostrum
sinnd...@gmail.com writes:

> Hi All,
> I am new to python.
> I have a irregular nested lists in a list.
> Please help me to iterate through each element.
>
> Thanks much in advance.
>
> Sample Ex
>
> aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]
>
> expected output:
> 2,jkj,,,kite,88,ooo,pop,push,pull,hello
>

Use a recursive iterator/generator: It becomes a bit peculiar because you want 
special treatment for empty lists inside, but otherwise it is quite standard 
Python:

aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]

def reclist(aList):
for item in aList:
if isinstance(item, list):
if item == []:
yield ''
else:
yield from reclist(item)
else:
yield item

for i in reclist(aList):
print(i, end=',')

This gives you an extra comma at the end, unfortunately. But it is the pattern 
for other types of processing.

Or use it like this:

print (','.join(str(i) for i in reclist(aList)))

--
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: iterate through an irregular nested list in Python

2020-03-07 Thread Dan Stromberg
On Fri, Mar 6, 2020 at 6:55 AM Pieter van Oostrum  
wrote:

> sinnd...@gmail.com writes:
>
> > Hi All,
> > I am new to python.
> > I have a irregular nested lists in a list.
> > Please help me to iterate through each element.
> >
> > Thanks much in advance.
> >
> > Sample Ex
> >
> > aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]
> >
> > expected output:
> > 2,jkj,,,kite,88,ooo,pop,push,pull,hello
> >
>
> Use a recursive iterator/generator:
> It becomes a bit peculiar because you want special treatment for empty
> lists inside,
> but otherwise it is quite standard Python:
>
> aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]
>
> def reclist(aList):
> for item in aList:
> if isinstance(item, list):
> if item == []:
> yield ''
> else:
> yield from reclist(item)
> else:
> yield item
>
> for i in reclist(aList):
> print(i, end=',')
>
> This gives you an extra comma at the end, unfortunately.
> But it is the pattern for other types of processing.
>
> Or use it like this:
>
> print (','.join(str(i) for i in reclist(aList)))
>

If your lists are nested to inconsistent depth, and you're on a modern version 
of Python (3.3 and up), recursion with yield from (as above) is the way to go.

If your lists are nested to a consistent depth (as your example seems to 
suggest), you can just:

for sublist in aList:
for element in sublist:
yield element

If you need inconsistent depth and you're on an old version of python, yield 
from is unavailable. In that case, it's best to write it out recursively (even 
though that won't work really), and modify that to be nonrecursive using an 
explicit stack or stacks. There's an example of this at: 
http://stromberg.dnsalias.org/svn/treap/trunk/m4_treap.m4
See iterator_macro.
Don't let the m4 throw you - it's just a way of deriving pure python and cython 
from the same file.
You can generate the pure python form the .m4 file with simply: m4 -Dpy=1 < 
m4_treap.m4 > py_treap.py
...if you install an m4 binary.

HTH.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python question

2020-03-07 Thread Souvik Dutta
This is not a place to quarrel our only task is to discuss and help other learn 
and learn ourselves. To Mr. Marco what Mr. Lee says is correct. Since he is 
working on a cryptocurrency project and he might use our original code in his 
final project I don't think offering money is bad. After all there have been 
times when a person demands his name to included in the credits page. Our sole 
task is to help. And you cannot form opinions for other people's by saying them 
not to support a person. That is injustice and rude.

On Fri, 6 Mar, 2020, 9:14 pm Mr. Lee Chiffre,  wrote:

> Thank you Marco for at least taking the time to read my message even if
> you do not agree with me on things. And no disrespect to you. But I came
> here for python related questions and help. Not to be called suspicious
> and untrustworthy only because I am concerned about security of users and
> for being a advocate of privacy. Then to call for me to be censored is
> just ludicrous.
>
>
> > People of Python List, I strongly discourage you to support this user.
> > He is quite suspicious for the following reasons:
> >
> > 1. he go so far as he offers money for, IMHO, a trivial task
>
> I said I am a python noob. This is why I asked for help. And I see no
> issue in offering payment for a programming task.
>
> > 2. he does not trust binaries from pip.
>
> What is the point of open source if you cannot compile from source code?
>
> > code. A lack of trust in open source projects that is quite unusual
> > 3. I don't trust any cryptocurrency.
>
> Not unusual. People use open source because they dont trust closed source.
> Binaries that someone else compiled is not open source.
>
> > I believe in privacy,  but not in financial privacy. Yes,
> > cryptocurrencies can be useful for circumvent bans from tyrannic
> > states. But they can, and _are_ used, primarily to:
> >  - wash dirty money, by criminals and mafias
> >  - evade taxes
> >  - buy highly unethical "products", like weapons... and who know what
> > other
> >  - finance tyrannies.
>
> Roads and cars are used by drug dealers. Stop using roads and cars. Cash
> is used by criminals. Stop using cash. Internet is used by child abusers.
> Stop supporting the internet. I am offended that you group me with
> criminals and baddies because I support technological privacy.
>
>
> >
> > I do _not_ think that all people that uses cryptocurrencies are
> > criminals. I had, for example, some co-workers that invested in
> > BitCoins, only for profit.
> >
> > But I do not trust this man, and I hope no one will offer support to
> > him. By my side, I'll report this discussion to moderators.
>
> That is fine if you dont like something. You dont have to help me out if
> you dont want to. But trying to censor me is unethical. Hopefully other
> people will have the logic to make decisions for themselves and give me
> help on python if they choose to do so.
>
> I hope my reply does not get censored. I am being reasonable here. And if
> you are wondering why I am "paranoid", you would be too if you are dealing
> with a server that might host a hot wallet. I dont want my server getting
> hacked just because I was too lazy to compile my own code. And it is not
> uncommon for binaries of open source projects to be injected with malware.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Application setup like windows msi

2020-03-07 Thread Grant Edwards
On 2020-03-05, Michael Torrie  wrote:
> On 3/4/20 4:51 PM, J A wrote:
>> I was wondering g if there was a way to distribute an application that took
>> advantage of user input like a windows .msi does. On linux of course.
>
> Several installer frameworks can make interactive installers for Linux.
> There's the NullSoft installer and InstallerVICE.  And quite a few
> commercial packages have rolled their own installers. Although I find
> installers of any kind of annoying on Linux and don't seem all that
> necessary.

I prefer a .tar file and a readme.txt file that says to run setup.py.

But then again, I run Gentoo. ;)

--
Grant Edwards   grant.b.edwardsYow! I guess it was all a
  at   DREAM ... or an episode of
  gmail.comHAWAII FIVE-O ...
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Help building python application from source

2020-03-07 Thread Ethan Furman
On 03/03/2020 01:50 PM, Marco Sulla via Python-list wrote:

> People of Python List, I strongly discourage you to support this user.
> He is quite suspicious for the following reasons:

Marco, this is not an appropriate response.  If you have concerns about list 
behavior then email the list owners.  If you have evidence of wrong-doing then 
email the list owners and do what you can to contact the appropriate 
authorities.

Asking the list to not help someone because you disagree with their beliefs 
will not be tolerated.  Consider this your warning.

--
~Ethan~
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: iterate through an irregular nested list in Python

2020-03-07 Thread Souvik Dutta
A better way would be to just do
nestedl = [[2], [], [], [l, b, n]]#nested list
for a in nestedl:   #taking all the sublist

  for b in a:   #iterating through the sub
 print(b)

Though it is easy the only limitation is that it works only if the elements are 
lists. Which we can be easily overcome by using an if statement to check the 
elements type.


On Fri, 6 Mar, 2020, 6:30 pm ,  wrote:

> Hi All,
> I am new to python.
> I have a irregular nested lists in a list.
> Please help me to iterate through each element.
>
> Thanks much in advance.
>
> Sample Ex
>
> aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]
>
> expected output:
> 2,jkj,,,kite,88,ooo,pop,push,pull,hello
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

On Fri, 6 Mar, 2020, 6:30 pm ,  wrote:

> Hi All,
> I am new to python.
> I have a irregular nested lists in a list.
> Please help me to iterate through each element.
>
> Thanks much in advance.
>
> Sample Ex
>
> aList = [[2,'jkj'],[],[],['kite',88,'ooo','pop','push','pull'],['hello']]
>
> expected output:
> 2,jkj,,,kite,88,ooo,pop,push,pull,hello
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36144] Dictionary union. (PEP 584)

2020-03-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 4663f66f3554dd8e2ec130e40f6abb3c6a514775 by Brandt Bucher in 
branch 'master':
bpo-36144: Update MappingProxyType with PEP 584's operators (#18814)
https://github.com/python/cpython/commit/4663f66f3554dd8e2ec130e40f6abb3c6a514775


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39702] PEP 614: Relaxing Grammar Restrictions On Decorators

2020-03-07 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 8f130536926a30237b5297780d61ef4232e88577 by Brandt Bucher in 
branch 'master':
bpo-39702: Update the Language Reference (PEP 614) (GH-18802)
https://github.com/python/cpython/commit/8f130536926a30237b5297780d61ef4232e88577


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 02f64cb79175902705b40e3eaa8ea6c7038754ef by Pablo Galindo in 
branch 'master':
bpo-39199: Use 'eval' mode for the examples with expression nodes (GH-18828)
https://github.com/python/cpython/commit/02f64cb79175902705b40e3eaa8ea6c7038754ef


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: ÿ in Unicode

2020-03-07 Thread Grant Edwards
On 2020-03-07, Jon Ribbens via Python-list  wrote:
> On 2020-03-06, Jon Ribbens  wrote:
>> What's the bug, or source of amusement?
>
> Oh, that's fun. There's a Russian Fidonet gateway, that somehow
> still exists, that's re-injecting usenet posts back into the group.

Last time I think it was one in Australia.

--
Grant



-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 928b4dd0edf0022190a8a296c8ea65e7ef55c694 by Miss Islington (bot) 
in branch '3.8':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/928b4dd0edf0022190a8a296c8ea65e7ef55c694


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: ÿ in Unicode

2020-03-07 Thread Richard Damon
On 3/7/20 12:52 PM, Ben Bacarisse wrote:
> moi  writes:
> 
>> Le samedi 7 mars 2020 16:41:10 UTC+1, R.Wieser a écrit :
>>> Moi,
>>>
 Fortunately, UTF-8 has not been created the Python devs.
>>>
>>> And there we go again, making vague statements/accusations - without 
>>> /anything/ to back it up ofcourse
>>>
>>> Kiddo, you have posted a couple of messages now, but have said exactly 
>>> nothing.   Are you sure you do not want to go into politics ?
>>>
>> The day, when this language will stop to interpret a byte
>> as being a Latin-1 (ISO-8859-1) character, this language will
>> start to work properly.
> 
 "ÿ".encode('iso-8859-1')
> b'\xff'
> 

or the reverse.

b'\xff'.decode('iso-8859-1')
'ÿ'

iso-8859-1 just isn't the DEFAULT character encoding to use.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f by Miss Islington (bot) 
in branch '3.7':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/cca0b31fb8ed7d25ede68f314d4a85bb07d6ca6f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: ÿ in Unicode

2020-03-07 Thread Ben Bacarisse
moi  writes:

> Le samedi 7 mars 2020 16:41:10 UTC+1, R.Wieser a écrit :
>> Moi,
>> 
>> > Fortunately, UTF-8 has not been created the Python devs.
>> 
>> And there we go again, making vague statements/accusations - without 
>> /anything/ to back it up ofcourse
>> 
>> Kiddo, you have posted a couple of messages now, but have said exactly 
>> nothing.   Are you sure you do not want to go into politics ?
>> 
> The day, when this language will stop to interpret a byte
> as being a Latin-1 (ISO-8859-1) character, this language will
> start to work properly.

>>> "ÿ".encode('iso-8859-1')
b'\xff'

-- 
Ben.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset eb7560a73d46800e4ade4a8869139b48e6c92811 by Pablo Galindo in 
branch 'master':
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient 
permissions (GH-18815)
https://github.com/python/cpython/commit/eb7560a73d46800e4ade4a8869139b48e6c92811


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +18188
pull_request: https://github.com/python/cpython/pull/18831

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38894] Path.glob() sometimes misses files that match

2020-03-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +18187
pull_request: https://github.com/python/cpython/pull/18830

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39886] Remove unused arg in config_get_stdio_errors in Python/initconfig.c

2020-03-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset aa450a0364b6160be7dd61ec2d378abb0652f014 by Andy Lester in branch 
'master':
closes bpo-39886: Remove unused arg from config_get_stdio_errors. (GH-18823)
https://github.com/python/cpython/commit/aa450a0364b6160be7dd61ec2d378abb0652f014


--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39878] Remove unused args in Python/formatter_unicode.c

2020-03-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset ad0c775ea24bb827410f01ece9f191309292bb95 by Andy Lester in branch 
'master':
closes bpo-39878: Remove unused arguments from static functions. (GH-18822)
https://github.com/python/cpython/commit/ad0c775ea24bb827410f01ece9f191309292bb95


--
nosy: +benjamin.peterson
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +18186
pull_request: https://github.com/python/cpython/pull/18828

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 65b031090161331470827ec809732008b15030d5 by Miss Islington (bot) 
in branch '3.7':
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
https://github.com/python/cpython/commit/65b031090161331470827ec809732008b15030d5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39199] Improve the AST documentation

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Would not be better to use mode='eval' for expression nodes?

Agreed! I will prepare a PR soon to simplify the expression examples.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-07 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Isn't this the same as https://bugs.python.org/issue36551 ?

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +18185
pull_request: https://github.com/python/cpython/pull/18827

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 92b72788ecf2ee5dfac780c7dfb5ee5350fc641d by Serhiy Storchaka in 
branch '3.8':
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
https://github.com/python/cpython/commit/92b72788ecf2ee5dfac780c7dfb5ee5350fc641d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18184
pull_request: https://github.com/python/cpython/pull/18826

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: ÿ in Unicode

2020-03-07 Thread R.Wieser
Moi,

> Fortunately, UTF-8 has not been created the Python devs.

And there we go again, making vague statements/accusations - without 
/anything/ to back it up ofcourse

Kiddo, you have posted a couple of messages now, but have said exactly 
nothing.   Are you sure you do not want to go into politics ?

Regards,
Rudy Wieser


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset c4928fc1a853f3f84e2b4ec1253d0349137745e5 by Serhiy Storchaka in 
branch 'master':
bpo-39889: Fix ast.unparse() for subscript. (GH-18824)
https://github.com/python/cpython/commit/c4928fc1a853f3f84e2b4ec1253d0349137745e5


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



wxjmfauth posts

2020-03-07 Thread Ethan Furman

All,

wxjmfauth is a known troll who posts on the usenet comp.lang.python.  Their 
posts are discarded from Python List.

If you choose to interact with them anyway, please:

- leave `wxjmfauth` in the attribution lines so those replies can be discarded
- keep your discourse civil

Thank you.

--
~Ethan~
Python List Moderator
--
https://mail.python.org/mailman/listinfo/python-list


[issue39888] modules not install

2020-03-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

This looks like a network problem on your end, not a python bug. The bug 
tracker is not the place to get help for such an issue. You might try the 
python-list mailing list, although your best bet is to find someone locally who 
can help you debug your network problem.

https://mail.python.org/mailman/listinfo/python-list

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-07 Thread hai shi


hai shi  added the comment:

> we have no idea what Py_mod_create might have done that needs to be cleaned 
> up.

Looks like no extension module author use `Py_mod_create` slots now.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34822] Simplify AST for slices

2020-03-07 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

Yes, there is an already PR about that the bug.

Related PR: https://github.com/python/cpython/pull/17892

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34822] Simplify AST for slices

2020-03-07 Thread Vedran Čačić

Vedran Čačić  added the comment:

Agree with the idea, but think the name is too narrow. How about 
`parethesized`? There are many contexts where parentheses look weird and can be 
omitted (e.g. after return statement), although subscripts are currently the 
only place where they are an outright error.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Using zipfile to create a zip file with directories and files inside those directories

2020-03-07 Thread Michael Torrie
On 3/7/20 1:08 AM, mus...@posteo.org wrote:
> On Fri, 6 Mar 2020 20:06:40 -0700
> Michael Torrie  wrote:
> 
>> The documentation talks about writing files from
>> disk, but I'm interested in creating these files from within Python
>> directly in the zip archive.
> 
> But you have seen writestr(), haven't you?

Yes, that's what I was using.  Turns out I didn't look closely enough at
the exception I was getting.  What i thought was zipfile complaining
about a '/' character was really Python complaining about a bad string
formatting string I was using!

Thanks for confirming that zipfile indeed should work the way I hoped it
wood. I'm in business now.

thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +18183
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18824

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39889] Fix ast.unparse() for subscription by extended slices and tuples

2020-03-07 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

ast.unparse() produces incorrect output for ExtSlice containing a single 
element:

>>> print(ast.unparse(ast.parse('a[i:j,]')))

a[i:j]

It also produces redundant parenthesis for Index containing Tuple:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[(i, j)]

--
components: Demos and Tools, Library (Lib)
messages: 363596
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix ast.unparse() for subscription by extended slices and tuples
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39888] modules not install

2020-03-07 Thread Mageshkumar


New submission from Mageshkumar :

pls kindly rectify it

--
components: Windows
files: modules install issues.txt
messages: 363595
nosy: magesh, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: modules not install
type: compile error
versions: Python 3.8
Added file: https://bugs.python.org/file48960/modules install issues.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14126] Speed up list comprehensions by preallocating the list where possible

2020-03-07 Thread Ammar Askar


Ammar Askar  added the comment:

Aah, thanks for the catcher Victor. Missed that this was about list 
/comprehensions/, not the list constructor.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34822] Simplify AST for slices

2020-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It was added to produce nicer output.

Currently:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[(i, j)]

With PR 9605:

>>> print(ast.unparse(ast.parse('a[i, j]')))

a[i, j]

The current code is not consistent with outputting parenthesis:

>>> print(ast.unparse(ast.parse('a[i:j, k]')))

a[i:j, k]

It also produces the same output for a[i:j] and a[i:j,] which have different 
AST and compiled to different bytecode (this is a bug).

>>> print(ast.unparse(ast.parse('a[i:j,]')))

a[i:j]

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: How to POST html data to be handled by a route endpoint

2020-03-07 Thread Νίκος Βέργος
You will see if you create a route endpoint called 'mailform' within '/' which 
is an alias of 'www.py' and you also have '/mailform' in 'superhost.gr/test' 
when the latter tries to post data to '/mailform' instead of sending them to 
'superhost.gr/test/' it sends them to '/' which is 'superhost.gr'
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34822] Simplify AST for slices

2020-03-07 Thread Nick Coghlan


Nick Coghlan  added the comment:

The one thing in the PR that makes me slightly wary is the point Vedran raised: 
in the old AST _Unparser code, the fact that index tuples containing slices 
should be printed without parentheses was encapsulated in the ExtSlice node 
type, but with Index and ExtSlice removed, that behaviour is now instead 
implemented by duplicating the visit_Tuple logic directly in visit_Subscript, 
purely to omit the surrounding parens.

So I agree that the parse tree simplification is an improvement, but I'm 
wondering if it might make sense to add an "is_subscript" attribute to 
expression nodes.

That way the Tuple vs ExtSlice and Expr vs Index distinctions would be 
preserved, but the representation of those distinctions would change in a way 
that meant that most consuming code didn't need to care that the distinctions 
existed (ExtSlice would become a Tuple with is_subscript set to True, and 
similarly, Index would become Expr instances with is_subscript set to True).

It's been so long since I changed the AST, though, that I'm not sure how 
painful adding that attribute would be.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >