Re: python server socket file transfer

2018-01-09 Thread dieter
bingbong3...@gmail.com writes: > how much client can i handel whit this code what the amount of client that i > can handel > the size of the file is 716 kb > ... > self.sock.send(l) Please read the documentation for *send* in the "socket" module: it tells you that "send" (in contrast to

pyplot: change the number of x labels (from 6)

2018-01-09 Thread Paulo da Silva
Hi all. I want to have dates as major ticks labels of X axis. This fragment of code works fine except that I need more dates to appear instead the 6 I am getting. The number of dates in dtsd is for ex. 262. Thanks for any help. BTW, I got most of this code from some site on the internet.

[issue2518] smtpd.py to handle huge email

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: test needed -> resolved

[issue19679] smtpd.py (SMTPChannel): implement enhanced status codes

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open

[issue14261] Cleanup in smtpd module

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: needs patch

[issue3802] smtpd.py __getaddr insufficient handling

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: test needed

[issue8503] smtpd SMTPServer does not allow domain filtering

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: test needed -> resolved

[issue19806] smtpd crashes when a multi-byte UTF-8 sequence is split between consecutive data packets

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: patch review

[issue22159] smtpd.PureProxy and smtpd.DebuggingServer do not work with decode_data=True

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: -> resolved

[issue22071] Remove long-time deprecated attributes from smtpd

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: patch review

[issue11260] smtpd-as-a-script feature should be documented and should use argparse

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: patch review -> resolved

[issue22158] RFC 6531 (SMTPUTF8) support in smtpd.PureProxy

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- nosy: +barry resolution: -> wont fix stage: -> resolved

[issue12816] smtpd uses library outside of the standard libraries

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and will likely not get any future development. Please see aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open

[issue25553] smtpd strips final carraige return from received message body

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and likely won't see much future improvements. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: needs patch ->

[issue26036] Unnecessary arguments on smtpd.SMTPServer

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix simce smtpd.py is deprecated and likely won't see any future improvements. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved

[issue16462] smtpd should return greeting

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm closing this as won't fix since smtpd.py is deprecated and likely won't see any fixes. Please take a look at aiosmtpd as a much better third party replacement. -- resolution: -> wont fix stage: -> resolved status: open ->

[issue19678] smtpd.py: channel should be passed to process_message

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'm going to close this as won't fix since smtpd.py is deprecated, and there's little chance that folks are still interested in working on it. See aiosmtpd as a much better third party replacement. -- resolution: -> wont fix

[issue12815] Coverage of smtpd.py

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: smtpd.py is deprecated so there's really almost zero chance we'll be doing any development on it. Please check out http://aiosmtpd.readthedocs.io/en/latest/ for a third party replacement (maybe pulled into the stdlib for 3.8?)

Re: Dunder variables

2018-01-09 Thread Steven D'Aprano
On Tue, 09 Jan 2018 16:14:27 +0200, Frank Millman wrote: > Maybe I was not clear. The Context instance is passed as an argument to > many methods. The methods can access the attributes of the instance. The > instance has no methods of its own. Ah, I see, I misunderstood. [...] >>

Re: How to create "transitional" package?

2018-01-09 Thread Thomas Jollans
On 09/01/18 05:09, INADA Naoki wrote: > Hi, all. > > Yesterday, I released msgpack-0.5, which was msgpack-python. > Both packages provide "msgpack" python package. > > I used msgpack in early days, but easy_install crawling website > and download msgpack-1.0.0.tar.gz, which is msgpack for C

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Mark Shannon
Mark Shannon added the comment: Can we stick to the one PR, please? Once it is merged then we can improve things. Also, I don't like leaving NULLs on the stack, they are an invitation to seg-fault. PR 5143 leaves more NULLs on the stack for longer. --

[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: > Oops, I merged the pull requests, but I forgot to close the issue. Oops, I forgot to close the issue, again... Thanks Segev for closing it, finally :-) -- ___ Python tracker

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 5143 is yet one alternative. It is a variant of PR 5006 that restores SETUP_EXCEPT and gets rid of the new opcode BEGIN_FINALLY. SETUP_FINALLY, SETUP_WITH and SETUP_ASYNC_WITH now push NULL on the stack instead. PR 5143

[issue32525] Empty tuples are not optimized as constant expressions

2018-01-09 Thread benrg
New submission from benrg : >From 3.3 on, the expression () is compiled to BUILD_TUPLE 0 instead of >LOAD_CONST. That's probably fine and I suppose it's slightly more efficient to >avoid adding an entry to the constant table. The problem is that BUILD_TUPLE 0 is not

[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2018-01-09 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +5002 ___ Python tracker ___ ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > Still, this feature is not appealing enough to try to squeeze into 3.7 > release schedule. I think this should go through a round of discussion > either on datetime-sig or python-ideas. Agreed. I will put together some summary in the

[issue32267] strptime misparses offsets with microsecond format

2018-01-09 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30121] Windows: subprocess debug assertion on failure to execute the process

2018-01-09 Thread Segev Finer
Change by Segev Finer : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue32524] Python 2.7 leaks a packages __init__.py module object on SyntaxError

2018-01-09 Thread Segev Finer
Change by Segev Finer : -- keywords: +patch pull_requests: +5001 stage: -> patch review ___ Python tracker ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > (And, honestly, `dateutil` would provide a version-independent backport > anyway). Why not start with that? Remember: python standard library is where code goes to die. By implementing this feature in dateutil you

[issue32524] Python 2.7 leaks a packages __init__.py module object on SyntaxError

2018-01-09 Thread Segev Finer
New submission from Segev Finer : With the file hello/__init__.py: ham = 123 spam()spam() I get the following: Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license"

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am about +0 on adding a keyword argument to datetime.now. Note that as I wrote in issue 19475 (msg202242), "precision" may be a misleading name because python makes no guarantee about the precision of the computer

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread breamoreboy
On Tuesday, January 9, 2018 at 3:22:30 PM UTC, Robert O'Shea wrote: > Hey all, > > Been subscribed to this thread for a while but haven't contributed much. > One of my ultimate goals this year is to get under the hood of CPython and > get a decent understanding of mechanics Guido and the rest of

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread David Stanek
On 09-Jan 15:21, Robert O'Shea wrote: > > Been subscribed to this thread for a while but haven't contributed much. +1. I'm a lurker too. > So besides just grabbing a chunk of CPython source code and digesting it, I > was wondering if those of you have read and understood the source code, do >

Re: CSV file edition

2018-01-09 Thread Alain Ketterlin
Manuel Rincon writes: [...] > Type=0 MarketTime=11:18:26.549 Price=112.8300 > Type=0 MarketTime=11:18:28.792 Price=112.8300 [...] > > I would need to filter only the numeric part of all the columns. I assume that by "numeric" you mean the value after Price=

CSV file edition

2018-01-09 Thread Manuel Rincon
Dear: With what function could you separate the numerical part of each column? MarketTime Price Type Type=0 MarketTime=11:18:26.549 Price=112.8300 Type=0 MarketTime=11:18:28.792 Price=112.8300 Type=0

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Alain Ketterlin
ElChino writes: > Chris Angelico wrote: > >> CPython is a stack-based interpreter, which means it loads values onto >> an (invisible) internal stack, processes values at the top of the >> stack, and removes them when it's done. > > Is this similar to how Lua operates too? No.

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > This can be accomplished rather efficiently by truncating a time tuple: This will not preserve tzinfo, and (though this is not a concern unless nanosecond precision is added), I don't believe it preserves microseconds either. That said,

python server socket file transfer

2018-01-09 Thread bingbong3334
how much client can i handel whit this code what the amount of client that i can handel the size of the file is 716 kb import socket from threading import Thread from SocketServer import ThreadingMixIn ## TCP_IP = '' TCP_PORT = 3156 BUFFER_SIZE = 1024 class ClientThread(Thread): def

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > replacing all elements of a datetime below a certain level is a very common > idiom This can be accomplished rather efficiently by truncating a time tuple: >>> t = datetime.now() >>> datetime(*t.timetuple()[:6])

[issue24340] co_stacksize estimate can be highly off

2018-01-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset d4864c61e3e27e337762dc45e504977299bd5b46 by Serhiy Storchaka in branch 'master': bpo-24340: Fix estimation of the code stack size. (#5076)

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: WIP pull request: https://github.com/python/cpython/pull/5141 (I'll not get back to this for a few days, sadly.) -- ___ Python tracker

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Change by Petr Viktorin : -- pull_requests: +5000 stage: -> patch review ___ Python tracker ___

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Chris Angelico
On Wed, Jan 10, 2018 at 6:20 AM, ElChino wrote: > Chris Angelico wrote: > >> CPython is a stack-based interpreter, which means it loads values onto >> an (invisible) internal stack, processes values at the top of the >> stack, and removes them when it's done. > > > Is this similar

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > I think that a "truncate to rrule" function is *way* beyond the scope of the > standard library I agree and I did not propose that. What I said was that in the process of implementing truncate to rrule in dateutil you

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you for the fix David! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: New changeset b4ebaa7099c3413b42a9581c4ca560fe7540 by Antoine Pitrou (David Carlier) in branch 'master': bpo-32493: Not only AIX, but FreeBSD has uuid_create support (#5089)

[issue32517] test_read_pty_output() of test_asyncio hangs on macOS 10.13.2 (darwin 17.3.0)

2018-01-09 Thread Matt Billenstein
Matt Billenstein added the comment: Note, I can repro running it by hand from the cli. And I cannot repro on 3.x, only 3.6 on the same machine. -- ___ Python tracker

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread ElChino
Chris Angelico wrote: CPython is a stack-based interpreter, which means it loads values onto an (invisible) internal stack, processes values at the top of the stack, and removes them when it's done. Is this similar to how Lua operates too? --

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > Looking at the dateutil, I don't see a truncate to rrule function. Maybe a > good starting point would be to implement that in dateutil and if some > simpler pattern emerges that can be proposed for stdlib, we can discuss it > then. I

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: Gah! The more I look into locks & forks ... the more I learn, to put it mildly. Instead of piling on workarounds, I'll try my hand at using native thread-local storage for pthread, and avoid the locking altogether. Hopefully that can make

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The problem that I have with the round/truncate proposal is that it is not general enough. Days, hours, minutes etc. are just arbitrary intervals that became popular for obscure historical and astronomical reasons. In

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: On Jan 9, 2018, at 08:33, Paul Ganssle wrote: > @Barry I don't think it's a good idea to duplicate the `replace` > functionality in `datetime` like that. I think the main problem isn't the > `.replace`, it's the

[issue10496] Python startup should not require passwd entry

2018-01-09 Thread Melissa Chang
Change by Melissa Chang : -- nosy: -Melissa Chang ___ Python tracker ___ ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: > In my experience, when dealing with temporal data truncation (rounding > towards -infinity) is more useful than any other form of rounding. See also > issue 19475. Ah, I agree - if you see that's how my __round__ implementation works. I

[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-01-09 Thread Michael Felt
Michael Felt added the comment: On 09/01/2018 16:21, Antoine Pitrou wrote: > Antoine Pitrou added the comment: > >> What is the desired behavior, specifically, of > uuid.getnode() - constant, or 'random'? > > I'm also certain getnode() is supposed to

[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: Pox, please retest with either 3.6.4 or 3.7.0a3 (or .0a4 when released, soon). Both were released after the merge that should fix this. -- ___ Python tracker

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: In my experience, when dealing with temporal data truncation (rounding towards -infinity) is more useful than any other form of rounding. See also issue 19475. -- ___ Python

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: One thing to note, the "example implementation" of __round__ above is an actual working prototype*: >>> round(Datetime.now(), 'second') Datetime(2018, 1, 9, 11, 59, 35) >>> round(Datetime.now(), 'day') Datetime(2018, 1, 9, 0, 0) >>>

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: I think if we're going to use `timedelta` then `__mod__` is the more appropriate option here, since it would be hard to interpret what `round(dt, timedelta(hours=2, microseconds=31))` would do. Either __mod__ or __round__ with `timedelta`

[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: @Pox, nevertheless, the fix committed in https://github.com/python/cpython/pull/4073 should also fix this issue. Do you disagree? -- ___ Python tracker

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Maybe __round__ can be generalized to take a timedelta instead of ndigits? For some related prior art, take a look at . -- ___

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: @Barry I don't think it's a good idea to duplicate the `replace` functionality in `datetime` like that. I think the main problem isn't the `.replace`, it's the fact that you have to specify exactly which components you want to set to zero

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Paul Moore
On 9 January 2018 at 16:18, Chris Angelico wrote: > On Wed, Jan 10, 2018 at 2:21 AM, Robert O'Shea > wrote: >> Hey all, >> >> Been subscribed to this thread for a while but haven't contributed much. >> One of my ultimate goals this year is to get

[issue32523] inconsistent spacing in changelog.html

2018-01-09 Thread Ned Deily
Ned Deily added the comment: See also discussion at https://github.com/python/core-workflow/issues/209 -- ___ Python tracker ___

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: Python 3 is not affected by this issue because it uses native thread locale storage (TLS): * pthread: pthread_getspecific() / pthread_setspecific() * Windows: TlsGetValue() / TlsSetValue() I'm not sure that it's doable to backport

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: The .replace(microseconds=0) hack annoys me too, but I'd be happier with a simpler solution: make datetime.now() accept a microseconds parameter, so datetime.now(microseconds=0) would be equivalent to datetime.now().replace(microseconds=0)

[issue32523] inconsistent spacing in changelog.html

2018-01-09 Thread Ned Deily
New submission from Ned Deily : The rendered changelog.html files produced "make html" have inconsistent spacing between items. Usually, the first changelog topic section (e.g. Security) starts with no blank lines between items but occasionally some subsequent sections will

Re: Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Chris Angelico
On Wed, Jan 10, 2018 at 2:21 AM, Robert O'Shea wrote: > Hey all, > > Been subscribed to this thread for a while but haven't contributed much. > One of my ultimate goals this year is to get under the hood of CPython and > get a decent understanding of mechanics Guido and

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Change by Paul Ganssle : -- type: -> enhancement ___ Python tracker ___ ___

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-01-09 Thread Marcel Plch
Marcel Plch added the comment: I have created a PR at https://github.com/python/cpython/pull/5140 It contains documentation, plus, in --with-pydebug mode, it calls m_traverse to catch easy cases of not handling the m_state==NULL case early. --

[issue31804] multiprocessing calls flush on sys.stdout at exit even if it is None (pythonw)

2018-01-09 Thread Pox TheGreat
Pox TheGreat added the comment: Unfortunately this is NOT a duplicate of https://bugs.python.org/issue28326. That issue is about a closed output stream. In that case sys.stdout and sys.stderr are file like objects which have been closed. This issue is about sys.stdout

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: @Victor: With regards to getting a "date as datetime", that is another way to do it that I have also done in the past (and in fact it's how the new dateutil.utils.today() function is implemented:

[RELEASE] Python 3.7.0a4 is now available for testing

2018-01-09 Thread Ned Deily
Python 3.7.0a4 is the last of four planned alpha releases of Python 3.7, the next feature release of Python. During the alpha phase, Python 3.7 remains under heavy development: additional features will be added and existing features may be modified or deleted. Please keep in mind that this is a

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
Paul Ganssle added the comment: An alternate possibility here might be to implement either `__round__` or a `round` function in `datetime` (which would basically automatically add this precision functionality to *all* the constructors, not just now). An example

[issue32374] Document that m_traverse for multi-phase initialized modules can be called with m_state=NULL

2018-01-09 Thread Marcel Plch
Change by Marcel Plch : -- pull_requests: +4999 ___ Python tracker ___ ___

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: There is a more general issue for any lock and fork(): bpo-6721, "Locks in the standard library should be sanitized on fork". -- ___ Python tracker

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread STINNER Victor
STINNER Victor added the comment: > dt = datetime.now(precision='day') Why not creating a date and then convert it to a datetime object? > dt = datetime.now().replace(microseconds=0) Yeah, that one annoys me as well, but I learnt the .replace(microseconds=0) hack,

[RELEASE] Python 3.7.0a4 is now available for testing

2018-01-09 Thread Ned Deily
Python 3.7.0a4 is the last of four planned alpha releases of Python 3.7, the next feature release of Python. During the alpha phase, Python 3.7 remains under heavy development: additional features will be added and existing features may be modified or deleted. Please keep in mind that this is a

[issue32522] Add precision argument to datetime.now

2018-01-09 Thread Paul Ganssle
New submission from Paul Ganssle : One thing I think that is fairly common is the desire to get the current datetime only up to a current precision, so you see a lot of things in, say, `dateutil` like this: dt = datetime.now().replace(hours=0, minutes=0, seconds=0,

Re: Dunder variables

2018-01-09 Thread D'Arcy Cain
On 01/09/2018 07:30 AM, Steven D'Aprano wrote: > If you have a class with only data, and you access the attributes via the > instance's __dict__, why not use an ordinary dict? Or even subclass dict. class MyClass(dict): VAR = 5 m = MyClass() m['newvar'] = "Something" I do this and wrap

[issue32493] UUID Module - FreeBSD build failure

2018-01-09 Thread David Carlier
David Carlier added the comment: I guessed that :-) I trusted it worked just fine for you. To be honest I know nearly nothing about AIX specificities :-) -- ___ Python tracker

Tips or strategies to understanding how CPython works under the hood

2018-01-09 Thread Robert O'Shea
Hey all, Been subscribed to this thread for a while but haven't contributed much. One of my ultimate goals this year is to get under the hood of CPython and get a decent understanding of mechanics Guido and the rest of you wonderful people have designed and implemented. I've been programming in

[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2018-01-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: > What is the desired behavior, specifically, of uuid.getnode() - constant, or 'random'? I'm also certain getnode() is supposed to return a hardware-determined number (usually the MAC address of an Ethernet interface). A random output

[issue29640] _PyThreadState_Init and fork race leads to inconsistent key list

2018-01-09 Thread Petr Viktorin
Petr Viktorin added the comment: I'm a bit out of my depth here. Victor, could you chime in? The problem with Harris' patch is that, once fork() is protected by the thread lock, acquiring that lock (by e.g. calling `PyGILState_GetThisThreadState`) from an `atfork` handler

Re: Dunder variables

2018-01-09 Thread Frank Millman
"Steven D'Aprano" wrote in message news:p32g4v$v88$2...@blaine.gmane.org... On Tue, 09 Jan 2018 11:28:03 +0200, Frank Millman wrote: > I have a class call Context containing only data, not methods. Instances > are passed around a lot in my application, with various methods > accessing various

[issue32007] nis module fails to build against glibc-2.26

2018-01-09 Thread Christian Heimes
Christian Heimes added the comment: #32521 is a duplicate of this issue. I didn't notice this issue when I created a fix. - I agree with Benjamin, let's deprecate the NIS module. NIS/YP functionality has been replaced by NSS a long time ago. - We have no infrastructure to

[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-09 Thread Thomas Wouters
Thomas Wouters added the comment: We do use Setup/Setup.local at Google (and have for many years now), and I find it very useful. (FWIW, the 'we would use' comment in msg294174 was about the new '*disabled*' feature, not about Setup files in general.) Avoiding local

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-09 Thread R. David Murray
R. David Murray added the comment: Well, it does support a persistent connection, but that connection lasts until it is shut down from the other side. Documentation improvement suggestions are welcome. -- ___ Python tracker

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-09 Thread R. David Murray
R. David Murray added the comment: In particular, if we don't already have an example of using the threading mixin we should, so a doc RFE to add that would be nice. -- ___ Python tracker

Re: Dunder variables

2018-01-09 Thread Steven D'Aprano
On Tue, 09 Jan 2018 11:28:03 +0200, Frank Millman wrote: > I have a class call Context containing only data, not methods. Instances > are passed around a lot in my application, with various methods > accessing various attributes. That contradicts itself... your Context class has data, but no

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2018-01-09 Thread Anant Prakash
Anant Prakash added the comment: Ignore my previous comment. My bad. -- ___ Python tracker ___

ANN: htmldammit 0.1

2018-01-09 Thread Tal Einat
I'm happy to announce htmldammit , a library for decoding binary HTML data into Unicode in the best possible way. Suggestions and comments are most welcome! Installation: `pip install htmldammit` Source: GitHub

NumPy 1.14.0 release

2018-01-09 Thread Charles R Harris
Hi All, On behalf of the NumPy team, I am pleased to announce NumPy 1.14.0. Numpy 1.14.0 is the result of seven months of work and contains a large number of bug fixes and new features, along with several changes with potential compatibility issues. The major change that users will notice are the

[issue32459] Capsule API usage docs are incompatible with module reloading (etc)

2018-01-09 Thread Petr Viktorin
Change by Petr Viktorin : -- nosy: +Dormouse759, encukou ___ Python tracker ___ ___

Re: Dunder variables

2018-01-09 Thread Frank Millman
"Frank Millman" wrote in message news:p321rb$9ct$1...@blaine.gmane.org... "Peter Otten" wrote in message news:p31v3m$pji$1...@blaine.gmane.org... Frank Millman wrote: > Hi all > > I have read that one should not call dunder methods in application code. > > Does the same apply to dunder

[issue30782] Allow limiting the number of concurrent tasks in asyncio.as_completed

2018-01-09 Thread Andy Balaam
Andy Balaam added the comment: I would argue that this makes as_completed a lot more useful than it is now, so would be worth adding (maybe after 3.7). But, if this does not go into asyncio, is there another library where it would belong? Or should this be a

[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)

2018-01-09 Thread Tom Karzes
Tom Karzes added the comment: Here's my situation: I originally used optparse, although some of the guys I worked with at the time were starting to use argparse. At first I thought, I'm sticking with optparse, it's more standard than argparse and probably better

[issue24459] Mention PYTHONFAULTHANDLER in the man page

2018-01-09 Thread Anant Prakash
Anant Prakash added the comment: I am going to take the patch, edit and make a github PR for this. Any updates on this issue are welcome. Thank you -- nosy: +Anant Prakash ___ Python tracker

  1   2   >