[issue33414] Make shutil.copytree use os.scandir to take advantage of cached is_(dir|file|symlink)

2018-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The code with using scandir() is more complex and is different enough from the 
code with using listdir() for having significant risk of introducing bugs. Also 
using scandir() introduces a risk of leaking file descriptors.

We don't rewrite the code without good reasons. If you propose performance 
enhancement, please provide benchmark results that expose the benefit of this 
change. If it is not large enough, it is not worth to do.

Actually your change looks making the code slower: it reads the directory twice.

--

___
Python tracker 

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



Re: Tracebacks for exceptions in interactively entered code.

2018-05-07 Thread Serhiy Storchaka

07.05.18 22:59, Terry Reedy пише:

I intend to improve the IDLE doc section on IDLE-console differences.


Don't haste to document it. The behavior of the standard interactive 
mode can be changed in 3.8.


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


[issue33096] ttk.Treeview.insert() does not allow to insert item with "False" iid

2018-05-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +6417

___
Python tracker 

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



[issue33441] Expose the sigset_t converter via private API

2018-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset d54cfb160c626626394e2f171d3ccfe03309f34e by Serhiy Storchaka in 
branch 'master':
bpo-33441: Make the sigset_t converter available in other modules. (GH-6720)
https://github.com/python/cpython/commit/d54cfb160c626626394e2f171d3ccfe03309f34e


--

___
Python tracker 

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



Suggestion for a "data" object syntax

2018-05-07 Thread Mikhail V
Here is an idea for 'data object' a syntax.
For me it is interesting, how would users find such syntax.
I personally find that this should be attractive from users
perspective.
Main aim is more readable presenting of typical data chunks
and some typical data types (tuples/lists) directly in code.
Further this should significantly simplify typing.

*Example 1. Multi-line strings*

Here is a 3 lines multi-line string, it will be automatically 'dedented'
by the parser by one level of indent:

data === S :
this is multi-line string
escape chars: same as in strings (\\, \\n, \\t ...) ,
but "no need to 'escape' quotes"

(Of course, assuming this feature will be added to the lexers
of your editor, otherwise it may mess up syntax highlighting)

So the proposed statement header is like:

variable === "type" :
...

The "===" token and type id's are of course subject to discussion.
"type" is type of data, which tells the parser to
convert data to specific type of Python object.
The above is type "S", a multi-line string.


*Example 2. Tuples*

Tuple is a data block with normal Python elements.

data === T :
123"hello"
abc + d

Here the separators of elements are : tab character,
new line (and maybe some white-space character like em-space?)
The above construct will be direct synonym for:

data = (1, 2, 3, "hello", a, b, c + d)

Benefits are easy to see: say I want a tuple of strings:

data === T :
"foo bar"
"hello world"
"to be continued..."

VS current:

data = (
"foo bar" ,
"hello world" ,
"to be continued..." ,
)

Main problem with the latter are commas, it is not easy
to type and, whats more important - hard to notice missing commas.
And brackets of course does not make it nicer either.

The above are typical cases where I see clear win, and
IMO they are quite common constructs.

More complicated examples :


*Example 3. Two-dimensional tuple.*

data === T/T :
123"hello"
ab c + de f

is a synonym for:

data = (
(1, 2, 3, "hello") ,
(a, b, c + d, e, f ) )

The rule here is: TAB character is inner elements' separator, and the
new line is outer elements' separator. Line continuation
character is  \  (to help with long lines).

*The benefits is just as in above examples :
readability and 'typeability' boost.*

To present nesting of elements of higher than 2 levels,
normal Python syntax can be used for deeper nesting:

data === T/T :
12(345)
ab c

Or maybe even allow commas:
data === T/T :
12(3, 4, 5)
ab c

VS normal:

data = (
(1, 2, (3, 4, 5) ) ,
(a, b, c ) )

So the idea is to cover only first two levels of
nesting of course.

Further, common types may be defined, like e.g. L/L (list of lists)
but I don't want to go far into details and want to stop
on common cases to help evaluate the idea in general.


*Main rules: *
- the definition is allowed  only as a statement (no passing as argument)
- (imo) data starts always as a new line after the header
- implicit string concatenation disallowed


So the question is, how do you like such syntax, and
if so, what common examples can be fit in here.
Any ideas, comments are of course welcome.
Suggest some data and I'll try to express it in this syntax.



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


Re: Module, Package

2018-05-07 Thread Ben Finney
Sharan Basappa  writes:

> One question. So, we can import the entire package or just a module in
> a given package. Is this correct?

Each time you ‘import foo’, you are getting a module.

> For example,
> import nltk

That results in a module object, and you can use the name ‘nltk’ to
reference that module.

> import nltk.stem

That results in a different module object, and you can use the name
‘nltk.stem’ (which is the name ‘stem’ in the namespace ‘nltk’) to
reference that module.

See the Python documentation for a good description of the import system
.

-- 
 \  “If we could change ourselves, the tendencies in the world |
  `\  would also change.” —Mohandas K. Gandhi, _Collected Works_, 1913 |
_o__)  |
Ben Finney

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


Re: Module, Package

2018-05-07 Thread Sharan Basappa
MRAB, ChirisA,

One question. So, we can import the entire package or just a module in a given 
package. Is this correct?

For example,
import nltk
import nltk.stem
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Module, Package

2018-05-07 Thread Sharan Basappa
On Monday, 7 May 2018 23:09:41 UTC+5:30, Chris Angelico  wrote:
> On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa  
> wrote:
> > I am a bit confused between module and package in Python.
> > Does a module contain package or vice versa?
> > When we import something in Python, do we import a module or a package?
> 
> You import a module.
> 
> A package is one particular form of module, which is built out of
> other modules (usually a directory full of .py files). There are a
> number of different sorts of modules; regardless, you 'import X' and
> get module X.
> 
> ChrisA

Thank you very much. Much appreiated
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: seeking deeper (language theory) reason behind Python design choice

2018-05-07 Thread Steven D'Aprano
On Mon, 07 May 2018 22:27:22 +0200, all-lists wrote:

> Hi,
> 
> I was wondering (and have asked on StackOverflow [1] in a more elaborate
> way) whether there is a deeper reason to not allow assignments in lambda
> expressions.

Currently, the real reason is that lambda expressions are limited to a 
single expression as the body of the function, and binding operations in 
Python are statements. It is as simple as that: you can't have

y = x + 1

inside a lambda for the same reason you can't have

import spam
while condition:
try:
this()
except Exception:
pass

Because lambda takes a single expression.

And the reason for *that* limitation is that after 20+ years of looking, 
nobody has come up with a satisfactory syntax for a multiple statement 
block expression which:

- is not ambiguous

- can be parsed by an LL(1) parser

- and meets Guido's approval.


Nobody has quite ruled out a block expression, in fact it is one of the 
acknowledged useful features which Ruby has that Python doesn't. So its 
not like we don't want it. Its just hard to do without ambiguity or a 
more complex parser.


> 
> I'm not criticising, I'm asking in order to know ;-)
> 
> The surface-reason is the distinction between assignments and
> statements, but why it was designed this way (with respect to lambda,
> not in general)?
> 
> So far, no satisfying answer has come up, except for maybe to avoid a
> programmer accidentally typing `=` instead of `==`, which I find a bit
> unsatisfying as the only reason.

No, that's the reason why = is a statement not an expression. That's not 
why statements aren't allowed in lambdas. If we had blocks, this would be 
perfectly acceptable:

lambda arg: %%%START BLOCK
spam = arg + 1
...
%%%END BLOCK

since = in a statement on its own is not dangerous. People *almost never* 
intend to write == for the side-effects only:

# don't care whether they are actually equal or not
# just want to call the __eq__ method for its side-effects
spam == arg + 1

Since that never happens in real life, there's no risk of accidentally 
writing "spam = arg + 1" when you wanted "spam == arg + 1".




-- 
Steve

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


[issue33414] Make shutil.copytree use os.scandir to take advantage of cached is_(dir|file|symlink)

2018-05-07 Thread Andrés Delfino

Change by Andrés Delfino :


--
keywords: +patch
pull_requests: +6416
stage:  -> patch review

___
Python tracker 

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



Re: Tracebacks for exceptions in interactively entered code.

2018-05-07 Thread Steven D'Aprano
On Mon, 07 May 2018 15:59:10 -0400, Terry Reedy wrote:

> I intend to improve the IDLE doc section on IDLE-console differences.
> 
> The following is from standard interactive mode (PSF CPython 3.7.0a4) on
> Windows (Win 10, Command Prompt)
> 
>  >>> def f():
> ... return 1/0
> ...
>  >>> f()
> Traceback (most recent call last):
>File "", line 1, in 
>File "", line 2, in f
> ZeroDivisionError: division by zero
> 
> Each statement is given the same pseudofile name, "", lines are
> numbered within each statement, and the code line is not printed.  As
> far as I remember, this has been the same on Windows since forever,
> though only current versions are relevant to current docs.
> 
> Is the above also the same on other systems (linux, Mac)?  I would like
> to know before I say so ;-).

Its the same here:

[steve@ando Python-3.6.4]$ ./python -E
Python 3.6.4 (default, Apr  2 2018, 12:16:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def f():
... return 1/x
...
>>> f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
NameError: name 'x' is not defined



-- 
Steve

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


Re: seeking deeper (language theory) reason behind Python design choice

2018-05-07 Thread Stefan Klinger
Chris Angelico (2018-May-08, excerpt):
> What exactly would be the scope of the assigned name?

Yes, that's more like the kind of answer I was seeking.  But I'm not
entirely satisfied.

> def sort_func(item):
> date = parse_date(item.creation_date)
> return date.day_of_week, date.year, date.month, date.day
> items.sort(key=sort_func)

This function contains two statements.  Would be nice to see a
one-statement variant that exposes the same necessity of local
assignment.

I have not thought about local assignment expressions, but they can
already now be done naturally as follows:

lambda item: (lambda date: date.day_of_week, date.year, date.month, 
date.day)(parse_date(item.creation_date)

But this is stretching the usefulness of Python's lambda (readability)
quite a bit, I have to admit.

Anyway, I was rather thinking about global assignment.  And there
would even be choice in whether it should be always global, Python has
a rule for that in the following case:

x = 23

def foo(y):
x = 2 * y   # this is local
print('x in foo', x)

print('x before foo', x)
foo(42)
print('x after foo', x)


class z:
v = 12345

def bar(y):
z.v = 2 * y # this is global
print('z.v in bar', z.v)

print('z.v before bar', z.v)
bar(0)
print('z.v after bar', z.v)

Cheers
Stefan


--
http://stefan-klinger.de  o/X
Send plain text messages only, not exceeding 32kB./\/
\
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem/bug with class definition inside function definition

2018-05-07 Thread Alexey Muranov

To be more exact, i do see a few workarounds, for example:


   def f4(a):
   b = a
   class D:
   a = b  # Works
   return D

But this is not what i was hoping for.

Alexey.

On Tue, 8 May, 2018 at 12:02 AM, Alexey Muranov 
 wrote:
I have discovered the following bug or problem: it looks like i am 
forced to choose different names for class attributes and function 
arguments, and i see no workaround.  Am i missing some special syntax 
feature ?


Alexey.

---
x = 42

class C1:
   y = x  # Works

class C2:
   x = x  # Works

# ---
def f1(a):
   class D:
   b = a  # Works
   return D

def f2(a):
   class D:
   a = a  # Does not work <
   return D

def f3(a):
   class D:
   nonlocal a
   a = a  # Does not work either <
   return D

# ---
def g1(a):
   def h():
   b = a  # Works
   return b
   return h

def g2(a):
   def h():
   a = a  # Does not work (as expected)
   return a
   return h

def g3(a):
   def h():
   nonlocal a
   a = a  # Works
   return a
   return h

# ---
if __name__ == "__main__":
   assert C1.y == 42
   assert C2.x == 42

   assert f1(13).b == 13

   try:
   f2(13)  # NameError
   except NameError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   try:
   f3(13).a  # AttributeError
   except AttributeError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   assert g1(13)() == 13

   try:
   g2(13)()  # UnboundLocalError
   except UnboundLocalError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   assert g3(13)() == 13



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


Problem/bug with class definition inside function definition

2018-05-07 Thread Alexey Muranov
I have discovered the following bug or problem: it looks like i am 
forced to choose different names for class attributes and function 
arguments, and i see no workaround.  Am i missing some special syntax 
feature ?


Alexey.

---
x = 42

class C1:
   y = x  # Works

class C2:
   x = x  # Works

# ---
def f1(a):
   class D:
   b = a  # Works
   return D

def f2(a):
   class D:
   a = a  # Does not work <
   return D

def f3(a):
   class D:
   nonlocal a
   a = a  # Does not work either <
   return D

# ---
def g1(a):
   def h():
   b = a  # Works
   return b
   return h

def g2(a):
   def h():
   a = a  # Does not work (as expected)
   return a
   return h

def g3(a):
   def h():
   nonlocal a
   a = a  # Works
   return a
   return h

# ---
if __name__ == "__main__":
   assert C1.y == 42
   assert C2.x == 42

   assert f1(13).b == 13

   try:
   f2(13)  # NameError
   except NameError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   try:
   f3(13).a  # AttributeError
   except AttributeError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   assert g1(13)() == 13

   try:
   g2(13)()  # UnboundLocalError
   except UnboundLocalError:
   pass
   except Exception as e:
   raise Exception( 'Unexpected exception raised: '
'{}'.format(type(e).__name__) )
   else:
   raise Exception('No exception')

   assert g3(13)() == 13

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


Re: seeking deeper (language theory) reason behind Python design choice

2018-05-07 Thread Chris Angelico
On Tue, May 8, 2018 at 6:27 AM,   wrote:
> Hi,
>
> I was wondering (and have asked on StackOverflow [1] in a more
> elaborate way) whether there is a deeper reason to not allow
> assignments in lambda expressions.
>
> I'm not criticising, I'm asking in order to know ;-)
>
> The surface-reason is the distinction between assignments and
> statements, but why it was designed this way (with respect to lambda,
> not in general)?
>
> So far, no satisfying answer has come up, except for maybe to avoid a
> programmer accidentally typing `=` instead of `==`, which I find a bit
> unsatisfying as the only reason.

What exactly would be the scope of the assigned name? Let's say we
have a fairly typical use of a lambda function:

items.sort(key=lambda item: item.creation_date)

Now let's change that a bit. How would assignment fit into that?

def sort_func(item):
date = parse_date(item.creation_date)
return date.day_of_week, date.year, date.month, date.day
items.sort(key=sort_func)

Makes sense - now we're putting everything made on a Tuesday before
everything made on a Friday (I'm sure that's important to someone,
somewhere). So obviously any assignment should be local to the lambda
function, right?

What about this lambda function?

click_count = 0
b = Button(master, text="Click me", command=lambda: click_count += 1)
b.pack()

Equally obviously, this assignment belongs in the surrounding scope.
It can't be both, though. How should that be resolved?

If you want a way to do assignment as part of an expression, join the
discussions about PEP 572. Have fun; it's probably approaching a
thousand emails so far.

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


seeking deeper (language theory) reason behind Python design choice

2018-05-07 Thread all-lists
Hi,

I was wondering (and have asked on StackOverflow [1] in a more
elaborate way) whether there is a deeper reason to not allow
assignments in lambda expressions.

I'm not criticising, I'm asking in order to know ;-)

The surface-reason is the distinction between assignments and
statements, but why it was designed this way (with respect to lambda,
not in general)?

So far, no satisfying answer has come up, except for maybe to avoid a
programmer accidentally typing `=` instead of `==`, which I find a bit
unsatisfying as the only reason.

There's a bounty on the StackOverflow question.

Thanks for reading!
Stefan


[1] 
https://stackoverflow.com/questions/50090868/why-are-assignments-not-allowed-in-pythons-lambda-expressions


--
http://stefan-klinger.de  o/X
Send plain text messages only, not exceeding 32kB./\/
\
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: use python to log to a remote supercomputer and transfer files

2018-05-07 Thread Irving Duran
You can also explore this package -> https://github.com/paramiko/paramiko
in order to be able to download or upload the files.

Thank You,

Irving Duran


On Mon, May 7, 2018 at 3:34 PM MRAB  wrote:

> On 2018-05-07 13:29, ruiyan wrote:
> > Hello everyone,
> >
> >
> > I need to conduct massive simulation computations using a software
> called 'lammps' on a remote supercomputer whose operating system is Linux
> every day. It's extremely annoying to log to the remote supercomputer,
> upload files to and download files from the supercomputer using WinSCP and
> Putty on my windows desktop computer. I want to know whether it is possible
> to write some scripts and let python do these things for me, i.e., I want
> to log to the remote supercomputer automatically, upload and download files
> with a simple hit in python (of course with the files specified). Is this
> possible? If it is possible, which packages do I need?
> >
> >
> > Thanks and best wishes,
> >
> There are some examples about scripting in WinSCP here:
>
> https://winscp.net/eng/docs/scripting
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: use python to log to a remote supercomputer and transfer files

2018-05-07 Thread MRAB

On 2018-05-07 13:29, ruiyan wrote:

Hello everyone,


I need to conduct massive simulation computations using a software called 
'lammps' on a remote supercomputer whose operating system is Linux every day. 
It's extremely annoying to log to the remote supercomputer,  upload files to 
and download files from the supercomputer using WinSCP and Putty on my windows 
desktop computer. I want to know whether it is possible to write some scripts 
and let python do these things for me, i.e., I want to log to the remote 
supercomputer automatically, upload and download files with a simple hit in 
python (of course with the files specified). Is this possible? If it is 
possible, which packages do I need?


Thanks and best wishes,


There are some examples about scripting in WinSCP here:

https://winscp.net/eng/docs/scripting
--
https://mail.python.org/mailman/listinfo/python-list


Tracebacks for exceptions in interactively entered code.

2018-05-07 Thread Terry Reedy

I intend to improve the IDLE doc section on IDLE-console differences.

The following is from standard interactive mode (PSF CPython 3.7.0a4) on 
Windows (Win 10, Command Prompt)


>>> def f():
... return 1/0
...
>>> f()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in f
ZeroDivisionError: division by zero

Each statement is given the same pseudofile name, "", lines are 
numbered within each statement, and the code line is not printed.  As 
far as I remember, this has been the same on Windows since forever, 
though only current versions are relevant to current docs.


Is the above also the same on other systems (linux, Mac)?  I would like 
to know before I say so ;-).


By comparison, IDLE prints

>>> def f():
return 1/0

>>> f()
Traceback (most recent call last):
  File "", line 1, in 
f()
  File "", line 2, in f
return 1/0
ZeroDivisionError: division by zero

Each statememt has a different pseudofile name (pyshell is the name 
IDLE's shell module) and the code lines are displayed just as when 
running from a real file.


--
Terry Jan Reedy

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


Re: Tk covering the entire screen

2018-05-07 Thread Skip Montanaro
On Sun, May 6, 2018 at 6:47 PM Skip Montanaro 
wrote:

> > Try to upgrade to 2.7.15. It should be shipped with Tk 8.6.
>
> Thanks. I'm using an internal (to work) Anaconda distro at work. Hopefully
> it will update soon.
>

​I got everything up-to-date, but still the cover window only covers two of
my three screens when run on Windows. The only thing I can think of which
might be a problem... When I bring up the Screen Resolution control panel,
my screens are numbered 3, 1, 2 left-to-right. Screens 1 and 2 are covered,
not three. If I change the screen order to 1, 2, 3 in the control panel,
The cover window does cover all three screens, but to move the pointer to
screen one, I have to move off the right of screen 3.

Gotta be a Windows thing. I'll call my help desk.

*sigh* I will never figure out Windows.

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


Re: www.python.org down

2018-05-07 Thread Chris Angelico
On Sun, May 6, 2018 at 9:22 PM, Gilmeh Serda
 wrote:
> On Mon, 30 Apr 2018 10:38:54 -0700, Jorge Gimeno wrote:
>
>> Not sure who to report to, but the site comes back with a 503. Anyone
>> know where I can direct this to?
>
> Why would you report it? Give it at least a day before you're going
> berserk with "reports"! If there's a serious problem, they will see to it
> that a replacement site is launched that will give info on what happened.
> Sit back and stay calm!
>
> Trust me, there is nothing more annoying than having to wade through a
> crapload of "error reports" early in the morning. And especially from
> those morons who end their reports with "What's wrong?" Gee, are you
> coming over to fix things?
>
> I wish I had a penny for every such "report" we receive to our external
> support box, I'd be rich today.
>

So you'd rather the site just stay down until the right person happens
to notice it?

Nice to know that your attitude towards your web site's users is that
they are "morons", and even more indicative that you consider that
people should let the site be down for a minimum of 86,400 seconds
before it's considered serious enough to actually report.

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


[issue33437] Defining __init__ in enums

2018-05-07 Thread Ethan Furman

Ethan Furman  added the comment:

Setting _value_ needs to happen in __new__ for those cases where another data 
type, such as str or int, is mixed in.

I'll look at adding an example to the docs.

Thanks for the report!

--
assignee:  -> ethan.furman
components: +Documentation
nosy: +barry, eli.bendersky, ethan.furman
type: enhancement -> behavior
versions: +Python 3.7, Python 3.8

___
Python tracker 

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



use python to log to a remote supercomputer and transfer files

2018-05-07 Thread ruiyan
Hello everyone, 


I need to conduct massive simulation computations using a software called 
'lammps' on a remote supercomputer whose operating system is Linux every day. 
It's extremely annoying to log to the remote supercomputer,  upload files to 
and download files from the supercomputer using WinSCP and Putty on my windows 
desktop computer. I want to know whether it is possible to write some scripts 
and let python do these things for me, i.e., I want to log to the remote 
supercomputer automatically, upload and download files with a simple hit in 
python (of course with the files specified). Is this possible? If it is 
possible, which packages do I need? 


Thanks and best wishes,


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


Re: Module, Package

2018-05-07 Thread Chris Angelico
On Tue, May 8, 2018 at 2:53 AM, Sharan Basappa  wrote:
> I am a bit confused between module and package in Python.
> Does a module contain package or vice versa?
> When we import something in Python, do we import a module or a package?

You import a module.

A package is one particular form of module, which is built out of
other modules (usually a directory full of .py files). There are a
number of different sorts of modules; regardless, you 'import X' and
get module X.

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


Re: Module, Package

2018-05-07 Thread MRAB

On 2018-05-07 17:53, Sharan Basappa wrote:

I am a bit confused between module and package in Python.
Does a module contain package or vice versa?
When we import something in Python, do we import a module or a package?


A module is a file. A package is a collection of one or more modules.
--
https://mail.python.org/mailman/listinfo/python-list


[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-07 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

Also it's a smaller win, but it might be worth considering whether we can avoid 
the import of 'nt' on posix platforms and vice-versa.

--

___
Python tracker 

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



Module, Package

2018-05-07 Thread Sharan Basappa
I am a bit confused between module and package in Python.
Does a module contain package or vice versa?
When we import something in Python, do we import a module or a package?

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


[issue33109] argparse: make new 'required' argument to add_subparsers default to False instead of True

2018-05-07 Thread Brian Skinn

Brian Skinn  added the comment:

I second Wolfgang's recommendation to change the default back to `False`.

I started developing CLI apps  in Python ~4yrs ago; I dabbled briefly in 
2.7, then switched firmly to Python 3.  When I started, I was aimed at 
supporting 3.3 to 3.5; now I'm specifically supporting 3.4 to 3.6, but starting 
to test my code against the 3.7b versions.

Thus, all I've ever known is the default `required=False` behavior. On my one 
tool currently using subparsers (https://github.com/bskinn/sphobjinv), I made 
the subparser choice optional, to allow a `sphobjinv --version` invocation. So, 
when 3.7 failed that test 
(https://github.com/bskinn/sphobjinv/blob/6c1f22e40dc3d129485462aec05adbed2ff40ab8/sphobjinv/test/sphobjinv_cli.py#L419-L422),
 it seemed like a regression to me.

All that said, given that the `subparsers.required = False` fix is a clean, 
single line, I have no beef with a `True` default if that's preferred. However, 
please include this change in the 3.7 CHANGELOG, at least.

--
nosy: +bskinn

___
Python tracker 

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



Re: itemgetter with default arguments

2018-05-07 Thread Peter Otten
Antoon Pardon wrote:

> On 05-05-18 09:33, Peter Otten wrote:
>> I think you have established that there is no straight-forward way to
>> write this as a lambda. But is adding a default to itemgetter the right
>> conclusion?
>>
>> If there were an exception-catching decorator you could write
>>
>> f = catch(IndexError, "spam")(itemgetter(2))
> 
> I think your catch function would be a usefull addition, but I don't see
> it solving this problem once we use itemgetter te get multiple entries.

Good catch()

;)

The obvious way, expressing the n-tuple case in terms of the solution for 
scalars

>>> f = lambda items: tuple(catch(IndexError, "spam")(itemgetter(i))(items) 
for i in (2, 1, 5))
>>> >>> f("abc")
('c', 'b', 'spam')

is a bit too complex to inline -- and also inefficient. You'd be tempted to 
factor out the repetetive parts

>>> f = lambda items, gets=[catch(IndexError, "spam")(itemgetter(i)) for i 
in (2, 1, 5)]: tuple(get(items) for get in gets)
>>> f("abc")
('c', 'b', 'spam')

and thus make it even less readable.

That said -- grepping my code I'm a bit surprised to find only

17 itemgetter(0)
 9 itemgetter(1)
 1 itemgetter(1, 0)
 1 itemgetter(*indices)

Checking /usr/lib/python3/dist-packages it looks like the situation is 
similar. I conclude that the most useful addition to the operator module 
would be

first = itemgetter(0)
second = itemgetter(1)


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


[issue3692] improper scope in list comprehension, when used in class declaration

2018-05-07 Thread Guido van Rossum

Guido van Rossum  added the comment:

> I don't think this will need drastic changes.

IIRC LOAD_NAME loads from the *local* scope, which will be the synthetic
function created for the comprehension (whose scope contains the loop
control variables). We may need a new opcode similar to LOAD_GLOBAL that
looks in two non-local directories rather than just one before falling back
to builtins; and the function object would need to have a link to both the
class dict and the global dict -- currently function objects gave a
__globals__ link but there's no chaining. Or perhaps __globals__ could be
set to a chainmap referencing the class dict and the globals?

--

___
Python tracker 

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



[issue33443] Typo in Python/import.c

2018-05-07 Thread Yuki Wakisaka

Change by Yuki Wakisaka :


--
pull_requests: +6414

___
Python tracker 

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



[issue33443] Typo in Python/import.c

2018-05-07 Thread Roundup Robot

Change by Roundup Robot :


--
keywords: +patch
pull_requests: +6413
stage:  -> patch review

___
Python tracker 

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



[issue33443] Typo in Python/import.c

2018-05-07 Thread Yuki Wakisaka

New submission from Yuki Wakisaka :

In the method, "_PyImportZip_Init(void)", of Python/import.c, the variable, 
"PyObject *path_hooks, *zimpimport;", seems to be typo, which can be 
"zipimport".

--
components: Interpreter Core
messages: 316273
nosy: ukwksk
priority: normal
severity: normal
status: open
title: Typo in Python/import.c
versions: Python 3.8

___
Python tracker 

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



Re: Weird side effect of default parameter

2018-05-07 Thread Robert Latest via Python-list
Steven D'Aprano wrote:
> Python function default values use *early binding*: the default parameter 
> is evaluated, ONCE, when the function is defined, and that value is used 
> each time it is needed.

Thanks, "early binding" was the clue I was missing.

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


[issue3692] improper scope in list comprehension, when used in class declaration

2018-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I don't think this will need drastic changes. Just setting some flags here or 
there for making comprehensions using LOAD_NAME instead of LOAD_GLOBAL. The fix 
should lie near the fix for issue33346.

--

___
Python tracker 

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



[issue3692] improper scope in list comprehension, when used in class declaration

2018-05-07 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

> Bug or not this is not going to change without a PEP, so I'm not sure it's a 
> good idea to keep this issue open.

I agree this requires a PEP. I would like to keep this open as a place for 
pre-PEP discussions among those interested (and as a remainder to maybe write 
such PEP).

--

___
Python tracker 

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



[issue33216] Wrong order of stack for CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW

2018-05-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue21592] Make statistics.median run in linear time

2018-05-07 Thread Dong-hee Na

Dong-hee Na  added the comment:

For CPython, I agree with the opinion that finding a median value with Tim 
sort(C version) is faster than quickselect algorithm with pure python.
Or we need to implement quickselect by C API.

The advantage of implementing this method by quickselect with pure python will 
be for pypy or any other python compatible compiler.

Considering the role that CPython provides for the standard library to other 
compatible compilers, it is worth considering from a performance point of view 
with a compatible compiler. However, for CPython, we have to take a performance 
hit.

Here is the benchmark result with pypy3 on MacOS

Nsort select7  select23 select47 select97 select   select2  PR6715
       ---  ---
50000.0000.0030.0000.0000.0000.0010.0010.001
   10.0000.0010.0010.0010.0010.0000.0000.001
   50.0020.0050.0040.0020.0020.0000.0000.000
  100.0050.0080.0040.0040.0050.0010.0010.001
  500.0270.0210.0160.0190.0210.0040.0030.003
 1000.0540.0350.0300.0370.0410.0060.0070.008
 2000.1040.0690.0630.0740.0840.0130.0130.015
 3000.1620.1050.0910.1090.1220.0170.0180.017
 4000.2190.1370.1220.1480.1670.0240.0160.024
 5000.2750.1700.1560.1820.2040.0300.0280.017
 6000.3360.2100.1810.2200.2470.0300.0390.040
 7000.4470.2830.2420.2920.3290.0560.0550.043
 8000.5030.3090.2480.3130.3380.0510.0490.052
 9000.5920.3590.3230.3530.4210.0650.0470.082
10000.6430.3980.3570.4120.4330.0610.0700.047
11000.7000.3870.3650.4540.4590.0870.0750.077

--
nosy: +corona10

___
Python tracker 

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



[issue33442] Python 3 doc sidebar dosnt follow page scrolling like 2.7 doc sidebar.

2018-05-07 Thread Pete Moore

New submission from Pete Moore <1petemo...@gmail.com>:

the 3.x docs sidebar at location 
https://docs.python.org/3.6/library/logging.html does not follow the user's 
scrolling movements like the 2.7 docs sidebar at location 
https://docs.python.org/2.7/library/logging.html

--
assignee: docs@python
components: Documentation
messages: 316269
nosy: docs@python, pete312
priority: normal
severity: normal
status: open
title: Python 3 doc sidebar dosnt follow page scrolling like 2.7 doc sidebar.
type: behavior
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
dependencies: +Expose the sigset_t converter via private API

___
Python tracker 

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



[issue20104] expose posix_spawn(p)

2018-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have doubts about combining setschedpolicy and setschedparam.

On one hand, they are set by independent functions in C and have separate 
flags. When pass arguments separately we don't need to invent a parameter name: 
just remove the common "posix_spawnattr_" prefix from corresponding C function 
names. Passing scheduler=(None, param) looks clumsy. And from implementation 
side, parsing separate arguments is easier that parsing a single argument as a 
2-tuple.

On other hand, these arguments are not completely independent: the 
setschedparam argument is required if setschedpolicy is specified.

Passing as separate arguments still looks more preferable to me.

--

___
Python tracker 

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



[issue33441] Expose the sigset_t converter via private API

2018-05-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +6412
stage:  -> patch review

___
Python tracker 

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



[issue33441] Expose the sigset_t converter via private API

2018-05-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

posix_spawn() (see issue20104) needs the converter to sigset_t defined in 
signalmodule.c. Since the code is not trivial, it is better to share it instead 
of duplicate. The proposed PR:

* Exposes the sigset_t converter via private API _Py_Sigset_Converter(). The 
implementation is moved to posixmodule.c.

* Uses Argument Clinic for parsing sigset_t in signalmodule.c. In particularly 
it causes that the first argument of signal.sigtimedwait() will be parsed 
before the second one.

* Make the converter always raising ValueError for signal numbers out of range 
1..NSIG. OverflowError was raised before for integers out of the platform 
depending C long range.

--
messages: 316267
nosy: pablogsal, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Expose the sigset_t converter via private API
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue33315] Allow queue.Queue to be used in type annotations

2018-05-07 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


--
assignee:  -> levkivskyi

___
Python tracker 

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



[issue33440] Possible lazy import opportunities in `pathlib`

2018-05-07 Thread Nick Coghlan

New submission from Nick Coghlan :

Due to a python-ideas discussion about reducing boilerplate for 
__file__-relative path calculations, I was running "./python -X importtime -S 
-c 'import pathlib'" and noticed three potential candidates where it may be 
worthwhile deferring the imports until the modules are actually needed:

- re (used in _WildcardSelector)
- fnmatch (used in PurePath.match and _WildcardSelector)
- urllib.parse (used in PurePath.as_uri, by way of self._flavour.make_uri)

Using an optimised Python 3.7 on an SSD with warm disk caches, commenting out 
those 3 imports reduced my typical import times for pathlib from 12-13 ms to 
7-8 ms)

--
components: Library (Lib)
messages: 316266
nosy: ncoghlan, njs, pitrou
priority: normal
severity: normal
status: open
title: Possible lazy import opportunities in `pathlib`
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-07 Thread Scott M

Scott M  added the comment:

7 years and counting... 
My need for a fix is long gone, but I'd like to be able to tell the original 
group I worked with whether it's now safe to use tkinter from threads. It looks 
like my original guesses were validated and a fix has been made, but I can't 
tell if it's universally available. What version of Python would they need to 
be on, and are any platforms still misbehaved "out of the box"? They will not 
be willing to rebuild python itself. TIA.

--

___
Python tracker 

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



[issue33439] python-config.py should be part of the stdlib

2018-05-07 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Rather than (or in addition to) being a standalone script, python-config should 
be invokable as a stdlib module, e.g. "python -m sysconfig.config".  This would 
prevent the risk of invoking the wrong script on PATH.

--
components: Build, Library (Lib)
messages: 316264
nosy: barry, doko, ncoghlan, pitrou
priority: normal
severity: normal
status: open
title: python-config.py should be part of the stdlib
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue33438] pkg-config file misses flags for static linking

2018-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Note that both implementations of python-config give the right information:

$ ./python python-config.py --libs
-lpython3.7m -lpthread -ldl -lutil -lm
$ sh python-config --libs
-lpython3.7m -lpthread -ldl  -lutil -lm

--

___
Python tracker 

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



[issue33422] Fix and update string/byte literals in help()

2018-05-07 Thread Andrés Delfino

Andrés Delfino  added the comment:

I was exploring pydoc, saw the literals as available help "terms" on the 
sysmbols section, and tried reading the help for one of them.

I learnt about IDLE debugging to trace this bug :)

--

___
Python tracker 

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



[issue33257] Race conditions in Tkinter with non-threaded Tcl

2018-05-07 Thread Scott M

Change by Scott M :


--
nosy: +PythonInTheGrass

___
Python tracker 

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



[issue33436] Add an interactive shell for Sqlite3

2018-05-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

It could be added in Tools/scripts directory or as a part of the sqlite3 module.

> It's not immediately obvious what benefits this provides over the existing 
> sqlite-native repl and the python repl.

The existing sqlite-native repl is not always installed when Python is 
installed (especially on Windows). It is handy that Python provides CLI to some 
modules, including zipfile and tarfile.

I would prefer CLI, but maybe both interfaces can be combined.

It would be nice to provide also a graphical Sqlite3 browser, which can be ran 
as a separate application and be integrated with IDLE (as turtledemo).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue33438] pkg-config file misses flags for static linking

2018-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

(correction: in the first message, I meant "on Linux" not "on Windows". Of 
course :-))

--

___
Python tracker 

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



[issue33438] pkg-config file misses flags for static linking

2018-05-07 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --static python
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs python
-L/home/antoine/cpython/37/usr/lib -lpython3.7m
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs-only-l python
-lpython3.7m
$ PKG_CONFIG_PATH=`pwd`/Misc pkg-config --libs-only-other python
$

--

___
Python tracker 

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



[issue33438] pkg-config file misses flags for static linking

2018-05-07 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Our pkg-config misses flags for static linking with libpythonXX.a, such as 
"-lpthread -lutil -lrt" on Windows.  For dynamic linking, this is not a problem 
since libpythonXX.so links explicitly against those system libraries.

--
components: Build
messages: 316258
nosy: barry, doko, pitrou
priority: normal
severity: normal
status: open
title: pkg-config file misses flags for static linking
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue33436] Add an interactive shell for Sqlite3

2018-05-07 Thread R. David Murray

R. David Murray  added the comment:

It's not immediately obvious what benefits this provides over the existing 
sqlite-native repl and the python repl. Can you expand a bit on the use case?  
Also, I seem to remember that Catherine Devlin had at one point thought about 
expanding her sqlpython to be multi-db capable, and while it doesn't look like 
that has happened, maybe that would be an alternative worth investigating?  
(I've never used it or looked at its code, so it may not be.)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue33437] Defining __init__ in enums

2018-05-07 Thread Andres Ayala

New submission from Andres Ayala :

I have to read and write many files for an old fortran program where the 
elements are coded as integer (so 0 is the X, 1 is the Y...) and I have some 
tags associated to each one.

So I tried to create an Enum with some additional fields:
class Coord(Enum):
def __init__(self, value, label, unit):
super().__init__()
self._value_ = value
self.label = label
self.unit = unit

PX = (0, 'P.X', 'km')
PY = (1, 'P.Y', 'km')
VX = (2, 'V.X', 'km/s')
VY = (3, 'V.Y', 'km/s')

This almost work:
>>> for element in CoordOk:
...print("{0}: {0.label}[{0.unit}] = {0.value}".format(element))
CoordOk.PX: P.X[km] = 0
CoordOk.PY: P.Y[km] = 1
CoordOk.VX: V.X[km/s] = 2
CoordOk.VY: V.Y[km/s] = 3

But fails recovering the coordinate from the value:
>>> print(Coord(0))
Traceback (most recent call last):
  File "/home/killerrex/tmp/demo.py", line 33, in 
print(Coord(0))
  File "/usr/lib64/python3.6/enum.py", line 291, in __call__
return cls.__new__(cls, value)
  File "/usr/lib64/python3.6/enum.py", line 533, in __new__
return cls._missing_(value)
  File "/usr/lib64/python3.6/enum.py", line 546, in _missing_
raise ValueError("%r is not a valid %s" % (value, cls.__name__))
ValueError: 0 is not a valid Coord

Because the internal value of the enum is (0, 'P.X', 'km') and not 0

I found that it is possible to do what I am trying to do with:
class CoordOk(Enum):
def __new__(cls, value, label, unit):
obj = object.__new__(cls)
obj._value_ = value
obj.label = label
obj.unit = unit
return obj

PX = (0, 'P.X', 'km')
PY = (1, 'P.Y', 'km')
VX = (2, 'V.X', 'km/s')
VY = (3, 'V.Y', 'km/s')

Following the latest doc from Enum. Although it is not so intuitive (defining 
__new__ is not as easy as __init__)

To make the first proposal work fine is enough with moving the line 221 of 
enum.py after the line 224 (see the patch)
I haven't found problems with the change but obviously my little reduced tests 
are not representative at all.
And even if it works there may be good reasons to not allow changing the 
_value_ in the init.

So mi enhancement proposal is either:
Add an example like the CoordOk to the documentation to help others to find how 
to change the _value_ (and an explanation on why is better not to do it in the 
__init__ would be perfect)

or

Change the line enum.py so it is possible to update the _value_ in the __init__ 
method and if you want use the Coord example in the docs.

Thanks!

--
components: Library (Lib)
files: enum_allow_change_value_in_init.patch
keywords: patch
messages: 316256
nosy: killerrex
priority: normal
severity: normal
status: open
title: Defining __init__ in enums
type: enhancement
versions: Python 3.6
Added file: 
https://bugs.python.org/file47575/enum_allow_change_value_in_init.patch

___
Python tracker 

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



EuroPython 2018: Call for Proposals (CFP) is open

2018-05-07 Thread M.-A. Lemburg
We’re looking for proposals on every aspect of Python: programming
from novice to advanced levels, applications and frameworks, or how
you have been involved in introducing Python into your
organization. EuroPython is a community conference and we are eager to
hear about your experience.


   * https://ep2018.europython.eu/en/call-for-proposals/ *


Please also forward this Call for Proposals to anyone that you feel
may be interested.


Important Notice: New Conference Layout
---

Please note that the conference layout has changed compared to
previous years, the main conference (talks) is now only three days:

* Monday and Tuesday:
trainings, workshops and Beginners’ Day only
* Wednesday, Thursday, Friday:
talks, panels, posters, helpdesks, open sessions, etc.
(no trainings!)


Submit your proposal


   * https://ep2018.europython.eu/en/call-for-proposals/ *

Submissions will be open until Sunday, May 20.

Given the compact timing this year, one should not bet on an
extension, please submit your proposals as early as possible - also to
reduce work load of the reviewers. Thank you.

Presenting at EuroPython


We will accept a broad range of presentations, from reports on
academic and commercial projects to tutorials and case studies. As
long as the presentation is interesting and potentially useful to the
Python community, it will be considered for inclusion in the program.

Can you show something new and useful? Can you show the attendees how
to: use a module? Explore a Python language feature? Package an
application? If so, please consider submitting a talk.

Submission types


* Regular Talk / approx. 110 slots
* Trainings / 12 slots.
* Panels
* Interactive
* Posters / 15 slots
* Helpdesk / 6 slots

Tracks
--

You may suggest your submission for a track. Tracks are groups of
talks, covering the same domain (e.g. Django), all in the same room in
a row. You may choose one of these specialized domains / tracks:

* Business Track (running a business, being a freelancer)
* DevOps
* Django Track
* Educational Track
* General Python
* Hardware/IoT Track
* PyData Track
* Science Track
* Web Track

PyData EuroPython 2018
--

As usual, there will be a PyData track at this year’s
conference.

The PyData track is run in cooperation with NumFocus and
the PyData Edinburgh meetup.

Discounts for Content Contributors
--

Since EuroPython is a not-for-profit community conference, it is not
possible to pay out rewards for talks or trainings.

For talks, posters, help desk and organizing a panels or interactive
sessions we will give out a 25% discount coupon valid for one
conference ticket.

Trainers will receive a 100% discount coupon for both a conference
ticket and a training pass to compensate for the longer preparation
time.

More details


Since there's a lot more detail to how the CFP works, please check the
CFP page for additional information:

   * https://ep2018.europython.eu/en/call-for-proposals/ *


Enjoy,
--
EuroPython 2018 Team
https://ep2018.europython.eu/
https://www.europython-society.org/


PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/993418719756996608
Thanks.

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


[issue32627] Header dependent _uuid build failure on Fedora 27

2018-05-07 Thread Adam

Adam  added the comment:

Some systems might have both uuid.h and uuid/uuid.h. For example, NetBSD 
provides /usr/include/uuid.h, and one might also install libuuid from a 
package, and the latter has uuid/uuid.h.

To fix this, do not include both files, when both have been detected.

Here is a patch:

--- Modules/_uuidmodule.c.orig
+++ Modules/_uuidmodule.c
@@ -3,8 +3,7 @@
 #include "Python.h"
 #ifdef HAVE_UUID_UUID_H
 #include 
-#endif
-#ifdef HAVE_UUID_H
+#elif defined(HAVE_UUID_H)
 #include 
 #endif

--
nosy: +a...@netbsd.org

___
Python tracker 

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



[issue33435] incorrect detection of information of some distributions

2018-05-07 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +6411

___
Python tracker 

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



Re: itemgetter with default arguments

2018-05-07 Thread Antoon Pardon
On 05-05-18 09:33, Peter Otten wrote:
> I think you have established that there is no straight-forward way to write 
> this as a lambda. But is adding a default to itemgetter the right 
> conclusion?
>
> If there were an exception-catching decorator you could write
>
> f = catch(IndexError, "spam")(itemgetter(2))

I think your catch function would be a usefull addition, but I don't see
it solving this problem once we use itemgetter te get multiple entries.

-- 
Antoon.

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


[issue33435] incorrect detection of information of some distributions

2018-05-07 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +6410
stage:  -> patch review

___
Python tracker 

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