Re: how to send a json of yield list

2016-10-13 Thread dieter
meInvent bbird writes: > after google a several solutions, > First method i searched has memory error > sock.send(json.dumps(StreamArray())) > Traceback (most recent call last): > File "pusher.py", line 43, in > sock.send(json.dumps(StreamArray())) > ... > MemoryError "MemoryError" means

Can't pickle : attribute lookup __builtin__.gen erator failed

2016-10-13 Thread meInvent bbird
Traceback (most recent call last): File "C:\Python27\lib\multiprocessing\queues.py", line 262, in _feed send(obj) PicklingError: Can't pickle : attribute lookup __builtin__.gen erator failed #python pusher.py tcp://*:8080 import sys import time import zmq from multiprocessing import Queue

cannot import name pyhop

2016-10-13 Thread Gipper
I'm trying to run a script that calls pyhop (from pyhop import pyhop). Details here > https://docs.extrahop.com/5.0/extrahop-python-api/#metrics I've followed the directions to install and import pyhop, but no matter what I do, I always get the following error when running a script that calls p

Re: Without compilation, how to find bugs?

2016-10-13 Thread Marko Rauhamaa
pozz : > All the tricks have a common goal: to discover bugs as soon as possible, > mostly during compilation process. Indeed I usually find some bugs > during compilation (or static analysis). It seems to me very important. Yes, it can be very useful, and with Python, you sacrifice that. > I wi

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> This suggests even the promoters of functional programming >> intuitively prefer imperative programming, but that's ok as long as >> it's all functional under the hood. > > You make it sound like functional programmers like functional > programming becaus

Re: Python-based monads essay part 2

2016-10-13 Thread Jussi Piitulainen
Gregory Ewing writes: > A bit more on SMFs, and then some I/O. > > http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads2.html Thanks. It would be good to spell out SMF at the start of the page. "The definition of / above" (__truediv__ method) was not given "above" (in th

how to use pycallgraph in ubuntu and window?

2016-10-13 Thread meInvent bbird
i install in ubunbu 14 pip install graphviz pip install pycallgraph martin@ubuntu:~/Downloads$ pycallgraph graphviz -- ./pusher.py Traceback (most recent call last): File "/usr/local/bin/pycallgraph", line 25, in with __pycallgraph.PyCallGraph(config=__config): File "/usr/local/lib/pytho

how to send a json of yield list

2016-10-13 Thread meInvent bbird
after google a several solutions, First method i searched has memory error sock.send(json.dumps(StreamArray())) Traceback (most recent call last): File "pusher.py", line 43, in sock.send(json.dumps(StreamArray())) File "C:\Python27\lib\json\__init__.py", line 243, in dumps return _de

Re: Without compilation, how to find bugs?

2016-10-13 Thread sohcahtoa82
On Thursday, October 13, 2016 at 4:06:36 PM UTC-7, pozz wrote: > I come from the C language, that is a compiled and strongly typed > language. I learned many good tricks to write good code in C: choose a > coding style, turn on as many warnings as possible, explicitly declare > static variables

Re: Without compilation, how to find bugs?

2016-10-13 Thread Skip Montanaro
One other thing. The OP mentioned coming from C. If you are old enough, you will remember that many errors caught by gcc and other modern compilers used to be detected by external checkers like lint. Most Makefiles had "lint" targets in them. So although you might associate all sorts of error dete

Re: Without compilation, how to find bugs?

2016-10-13 Thread Irmen de Jong
On 14-10-2016 1:07, pozz wrote: > All the tricks have a common goal: to discover bugs as soon as possible, > mostly during > compilation process. Indeed I usually find some bugs during compilation (or > static > analysis). It seems to me very important. I wanted to reply a bit more to this parag

Re: Without compilation, how to find bugs?

2016-10-13 Thread Ben Finney
pozz writes: > All the tricks have a common goal: to discover bugs as soon as > possible, mostly during compilation process. Indeed I usually find > some bugs during compilation (or static analysis). It seems to me very > important. Do you also use static code analysis? Do you find that static c

Re: Without compilation, how to find bugs?

2016-10-13 Thread Irmen de Jong
On 14-10-2016 1:07, pozz wrote: > I come from the C language, that is a compiled and strongly typed language. C is far from a strongly typed language, IMO... You can convert (cast) almost anything to anything else without compiler errors. Have a a float? Ah yes no I mean treat it as a pointer to

Re: Without compilation, how to find bugs?

2016-10-13 Thread Grant Edwards
On 2016-10-13, pozz wrote: > However, I think the language interpreter could emit the error before > launching the script even without executing the wrong instruction, > because it perfectly knows how many arguments the function wants and > that one instruction calls it with a wrong number of

Re: Without compilation, how to find bugs?

2016-10-13 Thread Skip Montanaro
> I can execute the script without any problem and I will not notice the bug until I > test exactly the erroneous line of code (the call with only one argument). The key phrase there being "until I test..." There are static analysis tools for Python like pylint. Given this simple module: #!/usr/

Without compilation, how to find bugs?

2016-10-13 Thread pozz
I come from the C language, that is a compiled and strongly typed language. I learned many good tricks to write good code in C: choose a coding style, turn on as many warnings as possible, explicitly declare static variables and functions (when needed), explicitly declare const variables (if t

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Gregory Ewing
Marko Rauhamaa wrote: This suggests even the promoters of functional programming intuitively prefer imperative programming, but that's ok as long as it's all functional under the hood. You make it sound like functional programmers like functional programming because it gives them a warm fuzzy f

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread eryk sun
On Thu, Oct 13, 2016 at 9:45 PM, Irmen de Jong wrote: > >>> On 12-10-2016 12:56, Robin Becker wrote: >>> I notice an extra space at the windows command prompt compared with 3.5, is that deliberate? > > Wow that was stupid, sorry. Anyway, I'm not seeing it with 3.6.0b2 either:

Python-based monads essay part 2

2016-10-13 Thread Gregory Ewing
A bit more on SMFs, and then some I/O. http://www.cosc.canterbury.ac.nz/greg.ewing/essays/monads/DemystifyingMonads2.html -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread MRAB
On 2016-10-13 22:45, Irmen de Jong wrote: On 13-10-2016 23:43, MRAB wrote: On 2016-10-13 20:42, Irmen de Jong wrote: On 12-10-2016 12:56, Robin Becker wrote: I notice an extra space at the windows command prompt compared with 3.5, is that deliberate? C:\ux\XB33>\python35\python Python 3.5.0

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread Irmen de Jong
On 13-10-2016 23:43, MRAB wrote: > On 2016-10-13 20:42, Irmen de Jong wrote: >> On 12-10-2016 12:56, Robin Becker wrote: >> >>> I notice an extra space at the windows command prompt compared with 3.5, is >>> that >>> deliberate? >>> C:\ux\XB33>\python35\python Python 3.5.0 (v3.5.0:374f50

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread MRAB
On 2016-10-13 20:42, Irmen de Jong wrote: On 12-10-2016 12:56, Robin Becker wrote: I notice an extra space at the windows command prompt compared with 3.5, is that deliberate? C:\ux\XB33>\python35\python Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit (AMD64)] on

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread Irmen de Jong
Anyone else having problems with pip and python 3.6.0b2? Pip now fails to create launcher scripts: File "c:\python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher result = finder(distlib_package).find(name).bytes File "c:\python36\lib\site-packages\pip\_ven

Re: [RELEASE] Python 3.6.0b2 is now available

2016-10-13 Thread Irmen de Jong
On 12-10-2016 12:56, Robin Becker wrote: > I notice an extra space at the windows command prompt compared with 3.5, is > that > deliberate? > >> C:\ux\XB33>\python35\python >> Python 3.5.0 (v3.5.0:374f501f4567, Sep 13 2015, 02:27:37) [MSC v.1900 64 bit >> (AMD64)] >> on win32 >> Type "help", "c

Re: try-except with no exceptions

2016-10-13 Thread Ben Finney
Daiyue Weng writes: > I am wondering how to correct the code above (what it tries to do is > basically trying one processing block, if not working, running another > block of code in except). Also a warning 'Too broad exception clause' > will be generated. Yes. You need to be *very* clear about

Re: try-except with no exceptions

2016-10-13 Thread Peter Otten
Daiyue Weng wrote: > Hi, I have seen code using try_except with no exceptions, > > from dateutil import parser > > try: > from_date = datetime.datetime.strptime(parameters['from_date'], > '%Y-%m-%d %H:%M:%S.%f') > to_date = datetime.datetime.strptime(parameters['to_date'], > '%Y-%m-%d %H

Re: try-except with no exceptions

2016-10-13 Thread Jussi Piitulainen
Daiyue Weng writes: > Hi, I have seen code using try_except with no exceptions, > > from dateutil import parser > > try: > from_date = datetime.datetime.strptime(parameters['from_date'], > '%Y-%m-%d %H:%M:%S.%f') > to_date = datetime.datetime.strptime(parameters['to_date'], > '%Y-%m-%d %H:

try-except with no exceptions

2016-10-13 Thread Daiyue Weng
Hi, I have seen code using try_except with no exceptions, from dateutil import parser try: from_date = datetime.datetime.strptime(parameters['from_date'], '%Y-%m-%d %H:%M:%S.%f') to_date = datetime.datetime.strptime(parameters['to_date'], '%Y-%m-%d %H:%M:%S.%f') except: from_date = pa

Re: how to read linux kernel source with pycparser

2016-10-13 Thread Michael Torrie
On 10/13/2016 02:19 AM, meInvent bbird wrote: > is it possible to git pull a part of directory such as sched > and compile this subdirectory and pycparser it? I'm sure you could but it wouldn't help you. The parts of the kernel are modular but you can't compile them without configuring the whole

[ANN] Zeus IDE - Version 3.98g released

2016-10-13 Thread jumppanen . jussi
Zeus does code folding, syntax highlighting, smart indenting, code navigation for the Python language. In addition the latest Zeus release has moved off Python 2.7x and now supports the latest Python 3.5x release. To see what new visit this link: http://www.zeusedit.com/whatsnew.html Jussi

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Marko Rauhamaa
Gregory Ewing : > Steve D'Aprano wrote: >> The way you can usually tell your functional language has given up >> purity in favour of mutating implementations is that your code >> actually runs with non-toy amounts of data :-) > > Hmmm. Your argument here seems to be: "Everyone knows that functional

Re: Python-based monads essay (Re: Assignment versus binding)

2016-10-13 Thread Gregory Ewing
Steve D'Aprano wrote: The way you can usually tell your functional language has given up purity in favour of mutating implementations is that your code actually runs with non-toy amounts of data :-) Hmmm. Your argument here seems to be: "Everyone knows that functional languages are impractical,

Re: how to read linux kernel source with pycparser

2016-10-13 Thread meInvent bbird
is it possible to git pull a part of directory such as sched and compile this subdirectory and pycparser it? i got error when run gcc -E git submodule add he...@github.com:hello/repo.git kernel/sched cd kernel/sched git pull martin@ubuntu:~/Downloads/kernel/sched$ gcc -E -std=c99 *.c # 1 "auto_g

Re: Scripting Help please

2016-10-13 Thread Steven D'Aprano
On Thursday 13 October 2016 07:37, LongHairLuke wrote: > Hi l am on my way to make a bot for the game Piano Tiles 2. > But the code l have written so far saids invalid syntax at 2nd line. Here is > my code: Folks, look at the email address of the poster: trolleri.trollface at gmail.com He's pos