Re: How to keep Dict[str, List] default method parameter as local to the method?

2020-06-14 Thread Dieter Maurer
zljubi...@gmail.com wrote at 2020-6-14 08:20 -0700: >Hi, > >consider this example: > >from typing import Dict, List > > >class chk_params: >def execute(self, params: Dict[str, List] = None): >if params is None: >params = {} > >for k, v in params.items(): >

Re: Asynchronous generators

2020-06-24 Thread Dieter Maurer
Jonathan Gossage wrote at 2020-6-23 14:04 -0400: >-- >I am attempting to learn how to use asyncio and I have been unable to find >any documentation or Internet posts that give information on the principles >underlying asyncio ... I am almost sure to have read an asyncio tutorial found via "python.

Re: property

2020-06-26 Thread Dieter Maurer
ast wrote at 2020-6-26 09:02 +0200: >Hello, > >I am wondering why this code is OK: > >class Temperature: > def __init__(self): > self.celsius = 0 > > fahrenheit = property() > > @fahrenheit.getter > def fahrenheit(self): > return 9/5*self.celsius +32 > > @fahrenheit.

Re: How to handle async and inheritance?

2020-07-01 Thread Dieter Maurer
Stephen Rosen wrote at 2020-6-30 11:59 -0400: >Hi all, > >I'm looking at a conflict between code sharing via inheritance and async >usage. I would greatly appreciate any guidance, ideas, or best practices >which might help. > >I'll speak here in terms of a toy example, but, if anyone wants to look

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-02 Thread Dieter Maurer
Rhodri James wrote at 2020-7-2 14:39 +0100: >We've had the requested 24 hour cooling off, and I don't imagine anyone >is surprised that the situation remains unchanged. The commit message >that caused the controversy is still in the PEP repository, and is still >controversial. Whether you think i

Re: Formal Question to Steering Council (re recent PEP8 changes)

2020-07-03 Thread Dieter Maurer
Random832 wrote at 2020-7-2 18:46 -0400: > ... the *whole idea* of "standard English" is tied to white supremacy, not > any particular standard whether via its authors or otherwise. PEP 8 was initially designed as a style specification for Python's runtime library. I hope we can agree that all do

Re: importlib: import X as Y; from A import B

2020-08-09 Thread Dieter Maurer
Jason Friedman wrote at 2020-8-8 21:23 -0600: > ... >The cherry-on-top would be to import with the "aliasing" and "from" they >will most likely see on the web, so that my code matches what they see >there. In other words, instead of: > >import pandas >df = pandas.from_csv (...) >import selenium >br

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-25 Thread Dieter Maurer
Samuel Marks wrote at 2020-8-24 18:24 +1000: >After a discussion on #python on Freenode, I'm here. > >The gist of it is: >> Falc - Signature of method 'Pharm.foo()' does not match signature of base >> method in class 'Base' > >What's the right way of specialising the children and leaving the Base

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-27 Thread Dieter Maurer
Samuel Marks wrote at 2020-8-27 15:58 +1000: >The main thing I want is type safety. I want Python to complain if the >callee uses the wrong argument types, and to provide suggestions on >what's needed and info about it. > >Without a base class I can just have docstrings and type annotations >to ach

Re: ABC with abstractmethod: kwargs on Base, explicit names on implementation

2020-08-29 Thread Dieter Maurer
Samuel Marks wrote at 2020-8-29 19:14 +1000: >So there is no way to get a AOT error when the two functions aren't >implemented, if the two functions have different required arguments on >implementors? > >To paint this picture for why I need this, say the first is: > >class Base(ABC): >@abstract

Re: Question from a "java background" developer

2020-09-22 Thread Dieter Maurer
Chris Angelico wrote at 2020-9-22 19:25 +1000: >On Tue, Sep 22, 2020 at 7:15 PM Agnese Camellini > wrote: >> >> Hello to everyone, I have a question. I come from a Java background and I >> would like to develop in python but i'm wondering: is there anything, in >> python, like Java "reflection"? >>

Re: Importing from within package

2020-09-23 Thread Dieter Maurer
Abdur-Rahmaan Janhangeer wrote at 2020-9-22 20:14 +0400: >I have this main script: >https://github.com/Abdur-rahmaanJ/shopyo/blob/dev/shopyo/__main__.py > >However, i get errors after package installation >saying: >ImportError: cannot import name 'shopyoapi' from 'shopyo' It is right: `shopyyoapi`

Re: Importing from within package

2020-09-23 Thread Dieter Maurer
Abdur-Rahmaan Janhangeer wrote at 2020-9-23 22:41 +0400: >In shopyo/shopyo (the same folder as __main__.py) there is a folder called >shopyoapi. Not in the distribution: ... shopyo-1.1.45/shopyo/ shopyo-1.1.45/shopyo/__init__.py shopyo-1.1.45/shopyo/__main__.py shopyo-1.1.45/shopyo/app.py shopyo-1

Re: error in install.sh

2020-09-30 Thread Dieter Maurer
RobH wrote at 2020-9-30 13:27 +0100: >I had to do a reinstall of my linux system due to a faulty ssd, and have >a problem with a install.sh script.The said script is included in with >lcd files. which I downloaded from github. > >When I run ./install.sh, it fails at >./install.sh: line 34: syntax e

Re: A library that converts a type-annotated function into a webpage with HTML forms?

2020-10-01 Thread Dieter Maurer
James Lu wrote at 2020-9-30 16:45 -0400: >Is there a python library available that converts a type-annotated Python >function into a webpage with HTML forms? > >Something like: > > >def foo(name: str, times: int): >return f"Hello {name}!" * times > >serve_from(foo, host="0.0.0.0", port=3000) >

Re: List of All Error Menssages

2020-10-02 Thread Dieter Maurer
Luis Gustavo Araujo wrote at 2020-10-1 16:06 -0300: >Is it possible to get the list of all error messages that display in >Python? I want the full message -> type error: additional message. > >Examples: >NameError: name 'x' is not defined >IndentationError: unindent does not match any outer indenta

Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Dieter Maurer
Samuel Marks wrote at 2020-10-15 20:53 +1100: > ... >To illustrate the issue, using `ml-params` and ml-params-tensorflow: > ... >What's the right solution here? While Python provides several modules in its standard library to process parameters (e.g. the simple `getopt` and the flexible `argparse`

Re: Re: CLI parsing—with `--help` text—`--foo bar`, how to give additional parameters to `bar`?

2020-10-15 Thread Dieter Maurer
Samuel Marks wrote at 2020-10-16 10:09 +1100: >Yes it’s my module, and I’ve been using argparse >https://github.com/SamuelMarks/ml-params > >No library I’ve found provides a solution to CLI argument parsing for my >use-case. Do you know that with `argparse` you can specify how many arguments an op

Re: Debugging a memory leak

2020-10-23 Thread Dieter Maurer
Pasha Stetsenko wrote at 2020-10-22 17:51 -0700: > ... >I'm a maintainer of a python library "datatable" (can be installed from >PyPi), and i've been recently trying to debug a memory leak that occurs in >my library. >The program that exposes the leak is quite simple: >``` >import datatable as dt >

Re: Debugging a memory leak

2020-10-23 Thread Dieter Maurer
Pasha Stetsenko wrote at 2020-10-23 11:32 -0700: > ... > static int my_init(PyObject*, PyObject*, PyObject*) { return 0; } > static void my_dealloc(PyObject*) {} I think, the `dealloc` function is responsible to actually free the memory area. I see for example: static void Spec_dealloc(Spec* se

Re: Question on ABC classes

2020-10-26 Thread Dieter Maurer
Peter J. Holzer wrote at 2020-10-25 20:48 +0100: >On 2020-10-22 23:35:21 -0700, Julio Di Egidio wrote: > ... >> and the whole lot, indeed why even subclass ABC? You often have the case that a base class can implement a lot of functionality based on a few methods defined by derived classes. An exa

Re: Post request and encoding

2020-11-03 Thread Dieter Maurer
Hernán De Angelis wrote at 2020-11-2 10:06 +0100: > ... >My request has the form: > >header = {'Content-type':'application/xml', 'charset':'utf-8'} Not your problem (which you have already resolved) but: `charset` is not an individual header but a parameter for the `Content-Type` header. For `xml`

Re: Questions about XML processing?

2020-11-07 Thread Dieter Maurer
Hernán De Angelis wrote at 2020-11-6 21:54 +0100: > ... >However, the hard thing to do here is to get those only when >tagC/note/title/string='value'. I was expecting to find a way of >specifying a certain construction in square brackets, like >[@string='value'] or [@/tagC/note/title/string='value'

Re: Python Client Rest API Invocation - POST with empty body - Invalid character found in method name [{}POST]. HTTP method names must be tokens

2020-11-20 Thread Dieter Maurer
Shelke, Bhushan wrote at 2020-11-19 15:12 +: >I have a Tomcat+Java based server exposing REST APIs. I am writing a client in >python to consume those APIs. Everything is fine until I send empty body in >POST request. It is a valid use case for us. If I send empty body I get 400 >bad request

Re: Automatically advancing a bi-directional generator to the point of accepting a non-None value?

2020-11-22 Thread Dieter Maurer
Go Luhng wrote at 2020-11-21 14:30 -0500: >Suppose we write a very simple bi-directional generator in Python: > >def share_of_total(): >s = 0 >new_num = 0 >while True: >new_num = yield new_num / (s or 1) >s += new_num > >share_calculator = sha

Re: ssl connection has been closed unexpectedly

2020-11-29 Thread Dieter Maurer
Shaozhong SHI wrote at 2020-11-28 23:29 +: >I keep getting the following error when I use engine = >create_engine(logging in details to postgres) >df.to_sql('table_name', and etc.) > > >OperationalError: (psycopg2.OperationalError) SSL connection has been >closed unexpectedly SSL works as foll

Re: A problem with opening a file

2020-11-29 Thread Dieter Maurer
Gabor Urban wrote at 2020-11-29 08:56 +0100: >I am facing an issue I was not able to solve yet. I have a class saving >messages to a file. The relevant code is: > > > >import OS >import sys > >class MxClass: > >def __init__(self, fName, fMode,): >self.fileName = fName >s

Re: Concatenating a Hash to a String

2020-12-01 Thread Dieter Maurer
"Ivan \"Rambius\" Ivanov" wrote at 2020-12-1 00:32 -0500: > ... >This code throws > >$ ./hashinstr.py >Traceback (most recent call last): > File "./hashinstr.py", line 16, in >gen_sql(s) > File "./hashinstr.py", line 13, in gen_sql >sql = "insert into HASHES value ('" + ehash + "')" >Typ

Re: Best-practice for formatted string literals and localization?

2020-12-01 Thread Dieter Maurer
Hartmut Goebel wrote at 2020-11-30 19:30 +0100: >formatted string literals are great, but can't be used together with >localization: > >_(f"These are {count} stones") > >will crash babel ("NameError: name 'count' is not defined". Translations are kept in external files (without any runtime ass

Re: Returning from a multiple stacked call at once

2020-12-12 Thread Dieter Maurer
ast wrote at 2020-12-12 07:39 +0100: >In case a function recursively calls itself many times, >is there a way to return a data immediately without >unstacking all functions ? Python does not have "long jump"s (out of many functions, many loop incarnations). In some cases, you can use exceptions to

Re: KeyboardInterrupt vs extension written in C

2005-10-22 Thread Dieter Maurer
"Tamas Nepusz" <[EMAIL PROTECTED]> writes on 20 Oct 2005 15:39:54 -0700: > The library I'm working on > is designed for performing calculations on large-scale graphs (~1 > nodes and edges). I want to create a Python interface for that library, > so what I want to accomplish is that I could just

Re: Python-based Document Management System?

2005-11-15 Thread Dieter Maurer
"W. Borgert" <[EMAIL PROTECTED]> writes on Thu, 10 Nov 2005 14:43:14 +0100: > I'm looking for a Python-based DMS, but I don't know any. > The following points are relevant: > > - suitable for 10..100 users with more than 1 documents > > - documents are mostly proprietary formats: MS Word, MS

Re: Profiling with hotshot and wall clock time

2005-11-26 Thread Dieter Maurer
Geert Jansen <[EMAIL PROTECTED]> writes on Thu, 24 Nov 2005 21:33:03 +0100: > ... > Is possible to use hotshot with wall clock time, i.e. is it possible > to have the code fragment below show one second as opposed to zero? > The old profiler seems to have functionality choosing a timer function >

Re: pyUnitPerf

2004-12-31 Thread Dieter Maurer
"Grig" <[EMAIL PROTECTED]> writes on 28 Dec 2004 18:47:45 -0800: > ... > My own experience with pyUnit has been very satisfactory and for me > personally pyUnitPerf scratches an itch. We use "pyUnit" extensively and are mostly satisfied. There is one essential problem we hit more often: setting u

Re: Embedding a restricted python interpreter

2005-01-08 Thread Dieter Maurer
Doug Holton <[EMAIL PROTECTED]> writes on Thu, 06 Jan 2005 20:34:31 -0600: > ... > Hi, there is a page on this topic here: > http://www.python.org/moin/SandboxedPython > > The short answer is that it is not possible to do this with the > CPython, but you can run sandboxed code on other virtual mac

Re: Embedding a restricted python interpreter

2005-01-17 Thread Dieter Maurer
Paul Rubin <http://[EMAIL PROTECTED]> writes on 08 Jan 2005 14:56:43 -0800: > Dieter Maurer <[EMAIL PROTECTED]> writes: > > It uses a specialized compiler that prevents dangerous bytecode operations > > to be generated and enforces a restricted builtin environment.

Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-27 Thread Dieter Maurer
Steven Bethard <[EMAIL PROTECTED]> writes on Tue, 25 Jan 2005 12:22:13 -0700: > Fuzzyman wrote: > ... > > A better (and of course *vastly* more powerful but unfortunately only > > a dream ;-) is a similarly limited python virutal machine. I already wrote about the "RestrictedPython" which is

Re: Unbound names in __del__

2005-06-18 Thread Dieter Maurer
Peter Hansen <[EMAIL PROTECTED]> writes on Fri, 17 Jun 2005 08:43:26 -0400: > ... > And I don't recall the last time I saw a __del__ in third-party code I > was examining. > > > What's your use case for del? I had to use one a few days ago: To call the "unlink" method of a "minidom" object

Re: importing packages from a zip file

2005-07-01 Thread Dieter Maurer
Scott David Daniels <[EMAIL PROTECTED]> writes on Wed, 29 Jun 2005 10:36:29 -0700: > Peter Tillotson wrote: > ... > > from myZip.zip import myModule.py > > > Does this work for you? It gives me a syntax error. > > Typically, put the zip file on the sys.path list, and import modules > and packa

Re: Use cases for del

2005-07-07 Thread Dieter Maurer
Daniel Dittmar <[EMAIL PROTECTED]> writes on Wed, 06 Jul 2005 16:12:46 +0200: > Peter Hansen wrote: > > Arguing the case for del: how would I, in doing automated testing, > > ensure that I've returned everything to a "clean" starting point in > > all cases if I can't delete variables? Sometimes a

Re: Conditionally implementing __iter__ in new style classes

2005-07-07 Thread Dieter Maurer
Thomas Heller <[EMAIL PROTECTED]> writes on Wed, 06 Jul 2005 18:07:10 +0200: > Thomas Heller <[EMAIL PROTECTED]> writes: > ... > > class Base: > > def __getattr__(self, name): > > if name == "__iter__" and hasattr(self, "Iterator"): > > return self.Iterator > > raise

Re: Revised PEP 349: Allow str() to return unicode strings

2005-08-24 Thread Dieter Maurer
Neil Schemenauer <[EMAIL PROTECTED]> writes on Mon, 22 Aug 2005 15:31:42 -0600: > ... > Some code may require that str() returns a str instance. In the > standard library, only one such case has been found so far. The > function email.header_decode() requires a str instance and the >

Re: Simpler transition to PEP 3000 "Unicode only strings"?

2005-09-21 Thread Dieter Maurer
"Petr Prikryl" <[EMAIL PROTECTED]> writes on Tue, 20 Sep 2005 11:21:59 +0200: > ... > The idea: > = > > What do you think about the following proposal > that goes the half way > > If the Python source file is stored in UTF-8 (or > other recognised Unicode file format), then the > en

Removing nested tuple function parameters (was: C#3.0 and lambdas)

2005-09-21 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Mon, 19 Sep 2005 10:31:48 +0200: > ... > meanwhile, over in python-dev land: > > "Is anyone truly attached to nested tuple function parameters; 'def > fxn((a,b)): print a,b'? /.../ Yes, I am... > Would anyone really throw a huge fit if t

Re: strange import phenomenon

2005-09-21 Thread Dieter Maurer
Christoph Zwerschke <[EMAIL PROTECTED]> writes on Tue, 20 Sep 2005 11:20:37 +0200: > Just hitting a strange problem with Python import behavior. It is the > same on all Python 2.x versions and it is probably correct, but I > currently don't understand why this happens. > ... > --- dir/__init__.py

Re: Zope: Adding a layer causes valid output to become an object reference?

2005-02-13 Thread Dieter Maurer
"Junkmail" <[EMAIL PROTECTED]> writes on 10 Feb 2005 18:26:52 -0800: > I've been playing with Zope for about a year and took the plunge last > week into making a product. You should send Zope related questions to the Zope mailing list. You will need to subcribe. You can do this at "http://www.zope

Re: unicode encoding usablilty problem

2005-02-21 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Sat, 19 Feb 2005 18:44:27 +0100: > "aurora" <[EMAIL PROTECTED]> wrote: > > > I don't want to mix them. But how could I find them? How do I know this > > statement can be > > potential problem > > > > if a==b: > > > > where a and b can be instantia

Re: ZoDB's capabilities

2005-03-02 Thread Dieter Maurer
Larry Bates <[EMAIL PROTECTED]> writes on Mon, 28 Feb 2005 18:48:39 -0600: > There is a VERY large website that uses Zope/ZODB that takes up to > 9000 hits per second when it gets busy. ZODB is very fast and > holds up well under load. But, you will not get 9000 hits per second from the ZODB (unl

Re: java crashes in python thread

2005-03-02 Thread Dieter Maurer
Easeway wrote: > I use os.system invoking java VM, when running in python thread, the > java application crashes. Andreas Jung has reported similar behaviour. He suggested that Java 1.4 and the threads of Linux 2.6 do not work reliably together. He tried Java 1.5 and this combination crashes only

Re: Python 3000 and "Python Regrets"

2004-12-03 Thread Dieter Maurer
Tim Peters <[EMAIL PROTECTED]> writes on Wed, 1 Dec 2004 13:38:49 -0500: > ... > > Are serious Python programmers already taking care to avoid > > using Python features that may disappear in Python 3000? > > No, although some naturally avoid dubious features without being > threatened . Are there

Re: Python2.4: building '_socket' extension fails with `INET_ADDRSTRLEN' undeclared

2004-12-05 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Sat, 04 Dec 2004 00:37:43 +0100: >... > So it appears that on your system, INET_ADDRSTRLEN is not defined, > even if it is supposed to be defined on all systems, regardless > of whether they support IPv6. I have met this problem in older Solaris vers

Re: How to set condition breakpoints?

2004-12-18 Thread Dieter Maurer
"Christopher J. Bottaro" <[EMAIL PROTECTED]> writes on Fri, 10 Dec 2004 11:45:19 -0600: > ... > Hmm, thanks for the suggestions. One more quick question. Is it even > possible to set a breakpoint in a class method in pdb.py? I can't even say > "break Class.f" without the condition. I don't thi

Re: Python SUDS issue

2013-03-06 Thread Dieter Maurer
VGNU Linux wrote at 2013-3-7 10:07 +0530: >Not aware what "import" here is and what it will do. XML-schema has an "import" facility to modularize schema descriptions. It is very similar to the "import" facilities you know from Python (and a lot of other languages) -- and has very similar purpose.

Re: Detecting socket connection failure

2006-07-15 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 10 Jul 2006 08:42:11 -0700: > I've tried to RTFM this and am having no luck.First off, I am using > Mac OSX 10.4.7 with python 2.4.2 from fink. I am trying to connect to > a server that should be rejecting connections and I was surprised when > it did not throw an e

Re: Detecting socket connection failure

2006-07-24 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 19 Jul 2006 08:34:00 -0700: > ... > Were you also using mac osx? No, I have observed the problem under Linux. > Dieter Maurer wrote: > > > I have seen something similar recently: > > > > I can write ("send" to be

Re: a bug in list.remove?

2006-08-21 Thread Dieter Maurer
Astan Chee <[EMAIL PROTECTED]> writes on Sat, 19 Aug 2006 03:34:26 +1000: > >>> for p in ps: > if p in qs: > ps.remove(p) You are modifying an object ("ps") while you iterate over it. This is a receipe for surprises... The standard idiom is to iterate over a copy rather than the obje

Re: Input from the same file as the script

2006-08-22 Thread Dieter Maurer
Georg Brandl <[EMAIL PROTECTED]> writes on Sun, 20 Aug 2006 20:08:38 +0200: > [EMAIL PROTECTED] wrote: > > Can the input to the python script be given from the same file as the > > script itself. e.g., when we execute a python script with the command > > 'python > When I ran the below the python i

Re: Possible inaccuracy in Python 2.4 when using profiler calibration

2006-06-16 Thread Dieter Maurer
Brian Quinlan <[EMAIL PROTECTED]> writes on Thu, 15 Jun 2006 10:36:26 +0200: > I have a misinformed theory that I'd like to share with the list. > > I believe that profiler calibration no longer makes sense in Python > 2.4 because C functions are tracked and they have a different call > overhead t

Re: need helping tracking down weird bug in cPickle

2006-06-23 Thread Dieter Maurer
[Carl J. Van Arsdall] > Hey everyone, cPickle is raising an ImportError that I just don't quite > understand. When I get in such a situation, I replace "cPickle" with Python's "pickle". Usually, I get the same exception -- but this time with a traceback that can be analysed with "pdb.pm()". Usuall

Re: Remote Boot Manager Scripting (Python)

2006-06-23 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 21 Jun 2006 07:43:17 -0700: > ... > I have to remotely start a computer. It has dual boot (WinXP and > Linux). > My remote computer is Linux which will send command to remotely boot > the other computer. > > Can we write python script or some utility which would let us

Re: Program slowing down with greater memory use

2006-06-25 Thread Dieter Maurer
Dan Stromberg <[EMAIL PROTECTED]> writes on Thu, 22 Jun 2006 23:36:00 GMT: > I have two different python programs that are slowing down quite a bit as > their memory use goes up. I have seen this too with Zope. I do not know where it comes from -- maybe from degraded locality. Dieter -- http:/

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-29 Thread Dieter Maurer
Greg Ewing <[EMAIL PROTECTED]> writes on Wed, 28 Jun 2006 11:56:55 +1200: >... > I have suggested that builtin functions should be > given the same method-binding behaviour as interpreted > functions. The idea wasn't rejected out of hand, but > I don't think anything has been done about it yet. Yo

Re: Don't use __slots__ (was Re: performance of dictionary lookup vs. object attributes)

2006-08-28 Thread Dieter Maurer
"Patrick Maupin" <[EMAIL PROTECTED]> writes on 26 Aug 2006 12:51:44 -0700: > ... > The only > problem I personally know of is that the __slots__ aren't inherited, "__slots__" *ARE* inherited, although the rules may be a bit complex. >>> class B(object): ... __slots__ = ('f1', 'f2',) ... >>> cla

Re: Survival of the fittest

2006-09-28 Thread Dieter Maurer
Thomas Bartkus <[EMAIL PROTECTED]> writes on Tue, 26 Sep 2006 22:06:56 -0500: > ... > We would be curious to know about those things you can do in C++ > but can't do in Python. I implemented an incremental search engine in Python. It worked fine for large quite specific "and" queries (it was fast

Re: Survival of the fittest

2006-10-03 Thread Dieter Maurer
Dennis Lee Bieber <[EMAIL PROTECTED]> writes on Thu, 28 Sep 2006 23:57:51 GMT: > On 28 Sep 2006 22:48:21 +0200, Dieter Maurer <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > We learn: a C/C++ implementation can in some cases be drastically >

Re: Tons of stats/opens to non-existing files increases Python's startupon loaded NFS servers

2005-05-06 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Fri, 6 May 2005 00:08:36 +0200: > > ... lots of "no such file or directory ... > > Whoa!! After looking at what is being stat'd or > > open'd, it looks like 'encodings' is new in 2.4 and, > > even "worse", everything is looked for as a zip first. > > s

Re: Is Python suitable for a huge, enterprise size app?

2005-05-21 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Thu, 19 May 2005 09:54:15 +0200: > ... > and unless your operating system is totally braindead, and thus completely > unfit > to run huge enterprise size applications, that doesn't really matter much. > leaks > are problematic, large peak memory use

Re: python24.zip

2005-05-21 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Fri, 20 May 2005 18:13:56 +0200: > Robin Becker wrote: > > Firstly should python start up with non-existent entries on the path? > > Yes, this is by design. > > > Secondly is this entry be the default for some other kind of python > > installation?

Re: python24.zip

2005-05-22 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Sat, 21 May 2005 23:53:31 +0200: > Dieter Maurer wrote: > ... > > The question was: > > > >"should python start up with **non-existent** objects on the path". > > > > I think there i

Re: python24.zip

2005-05-22 Thread Dieter Maurer
Steve Holden <[EMAIL PROTECTED]> writes on Sun, 22 May 2005 09:14:43 -0400: > ... > There are some aspects of Python's initialization that are IMHO a bit > too filesystem-dependent. I mentioned one in > > > > http://sourceforge.net/tracker/index.php?func=detail&aid=1116520&group_id=5470&atid=10

Re: python24.zip

2005-05-24 Thread Dieter Maurer
Steve Holden <[EMAIL PROTECTED]> writes on Sun, 22 May 2005 16:19:10 -0400: > ... > Indeed I have written PEP 302-based code to import from a relational > database, but I still don't believe there's any satisfactory way to > have [such a hooked import mechanism] be a first-class component of an > a

Re: python24.zip

2005-05-24 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Sun, 22 May 2005 21:24:41 +0200: > ... > What do you mean, "unable to"? It just doesn't. The original question was: "why does Python put non-existing entries on 'sys.path'". Your answer seems to be: "it just does not do it -- but it might be changed

Re: Is Python suitable for a huge, enterprise size app?

2005-05-27 Thread Dieter Maurer
"Fredrik Lundh" <[EMAIL PROTECTED]> writes on Tue, 24 May 2005 22:38:05 +0200: > ... > nothing guarantees that, of course. but I've never seen that > happen. and I'm basing my comments on observed behaviour in > real systems, not on theoretical worst-case scenarios. I observed in real systems (Zo

Re: python24.zip

2005-05-27 Thread Dieter Maurer
"Martin v. Löwis" <[EMAIL PROTECTED]> writes on Tue, 24 May 2005 23:58:03 +0200: > ... 10.000 failing opens -- a cause for significant IO during startup ? ... > So I would agree that IO makes a significant part of startup, but > I doubt it is directory reading (unless perhaps you have an > absent

Re: python24.zip

2005-05-27 Thread Dieter Maurer
Scott David Daniels <[EMAIL PROTECTED]> writes on Wed, 25 May 2005 07:10:00 -0700: > ... > I'll bet this means that the 'zope.zip', 'python24.zip' would drop > you to "about 12500 - 1 = 2500" failing opens. That should be > an easy test: sys.path.insert(0, 'zope.zip') or whatever. > If that w

Re: some profiler questions

2005-06-09 Thread Dieter Maurer
"Mac" <[EMAIL PROTECTED]> writes on 7 Jun 2005 20:38:51 -0700: > > 1) I'd still like to run my whole app (i.e., using main()), but I'd > like to limit the profiling to only the select few subroutines. That > is, say I have a set of such fns in mind, call it "key_fns", and I > would like to on

Re: subprocess module and blocking

2005-06-13 Thread Dieter Maurer
Robin Becker <[EMAIL PROTECTED]> writes on Sun, 12 Jun 2005 09:22:52 +: > I'm using a polling loop in a thread that looks approximately like this > > while 1: > p = find_a_process() > rc = p.poll() > if rc is not None: > out, err = p.communicate() > #deal with

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Dieter Maurer
kamal hamzat wrote at 2007-9-28 16:36 +0100: >I have this error after i added the if statement > >Error Type: TypeError >Error Value: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'int' > > >for i in context.zCatNewsCurrent(): > if i <= 5: >print "%s: %s: %s" % (i.id, i.a

Re: pythonic backtrace with gdb

2008-01-24 Thread Dieter Maurer
Hynek Hanke <[EMAIL PROTECTED]> writes on Wed, 23 Jan 2008 14:30:22 +0100: > ... > I've also tried to use the backtrace script here > http://mashebali.com/?Python_GDB_macros:The_Macros:Backtrace > But I get a different error: > (gdb) pbt > Invalid type combination in ordering comparison. > > I'm u

Re: ZSI and attachments

2008-03-14 Thread Dieter Maurer
Laszlo Nagy <[EMAIL PROTECTED]> writes on Tue, 11 Mar 2008 15:59:36 +0100: > I wonder if the newest ZSI has support for attachments? Last time I > checked (about a year ago) this feature was missing. I desperately > need it. Alternatively, is there any other SOAP lib for python that > can handle at

Re: Profiling Python

2008-12-06 Thread Dieter Maurer
[EMAIL PROTECTED] writes on Wed, 3 Dec 2008 07:13:14 -0800 (PST): > To clarify again, > Is there some function like profile.PrintStats() which dynamically > shows the stats before stopping the Profiler? Try to (deep) copy the profiler instance and than call "PrintStats()" on the copy. Of course,

Re: The Importance of Terminology's Quality

2008-05-13 Thread Dieter Maurer
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes on Wed, 7 May 2008 16:13:36 -0700 (PDT): > ... > Let me give a few example. > > • “lambda”, widely used as a keyword in functional languages, is named > just “Function” in Mathematica. The “lambda” happend to be called so > in the field of symbolic l

Nested generator caveat

2008-07-03 Thread Dieter Maurer
I met the following surprising behaviour >>> def gen0(): ... for i in range(3): ... def gen1(): ... yield i ... yield i, gen1() ... >>> for i,g in gen0(): print i, g.next() ... 0 0 1 1 2 2 >>> for i,g in list(gen0()): print i, g.next() ... 0 2 1 2 2 2 If this is not a bug, it is

Re: Tremendous slowdown due to garbage collection

2008-04-27 Thread Dieter Maurer
Christian Heimes <[EMAIL PROTECTED]> writes on Sat, 12 Apr 2008 18:47:32 +0200: > [EMAIL PROTECTED] schrieb: > > which made me suggest to use these as defaults, but then > > Martin v. Löwis wrote that > > > >> No, the defaults are correct for typical applications. > > > > At that point I felt los

Re: Tremendous slowdown due to garbage collection

2008-04-28 Thread Dieter Maurer
"Martin v. Löwis" wrote at 2008-4-27 19:33 +0200: >> Martin said it but nevertheless it might not be true. >> >> We observed similar very bad behaviour -- in a Web application server. >> Apparently, the standard behaviour is far from optimal when the >> system contains a large number of objects an

Re: Remove multiple inheritance in Python 3000

2008-04-28 Thread Dieter Maurer
Nick Stinemates <[EMAIL PROTECTED]> writes on Thu, 24 Apr 2008 08:26:57 -0700: > On Tue, Apr 22, 2008 at 04:07:01AM -0700, GD wrote: > > Please remove ability to multiple inheritance in Python 3000. I hope your request will not be followed. > > Multiple inheritance is bad for design, rarely used

Re: Tremendous slowdown due to garbage collection

2008-05-01 Thread Dieter Maurer
John Nagle <[EMAIL PROTECTED]> writes on Mon, 28 Apr 2008 11:41:41 -0700: > Dieter Maurer wrote: > > Christian Heimes <[EMAIL PROTECTED]> writes on Sat, 12 Apr 2008 18:47:32 > > +0200: > >> [EMAIL PROTECTED] schrieb: > >>> which made me sugg

Re: Large production environments using ZODB/ZOE?

2008-08-17 Thread Dieter Maurer
Phillip B Oldham <[EMAIL PROTECTED]> writes on Thu, 7 Aug 2008 09:26:04 -0700 (PDT): > I've been reading a lot recently on ZODB/ZOE, but I've not seen any > reference to its use in large-scale production envrironments. > > Are there any real-world examples of ZODB/ZOE in use for a large > system?

Re: Interrupt python thread

2008-08-30 Thread Dieter Maurer
En Mon, 25 Aug 2008 05:00:07 -0300, BlueBird <[EMAIL PROTECTED]> escribi╴: > Unfortunately, this does not map very well with my program. Each of my > threads are calling foreign code (still written in python though), > which might be busy for 1 to 10 minutes with its own job. > > I wanted something

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
Mailing List SVR <[EMAIL PROTECTED]> writes on Tue, 16 Sep 2008 08:31:13 +0200: > ... > however my server require client > certificate authentication, > > does soaplib or zsi work in this environment? ZSI allows you to provide an alternative transport. That's the usual way to let ZSI work over "h

Re: Zsi interoperability

2008-09-18 Thread Dieter Maurer
"Marco Bizzarri" <[EMAIL PROTECTED]> writes on Mon, 15 Sep 2008 20:26:27 +0200: > On Mon, Sep 15, 2008 at 8:15 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote: > > Mailing List SVR wrote: > >> I have to implement a soap web services from wsdl, the server is > >> developed using oracle, is zsi or some o

Re: SOAPpy, WSDL and objects

2006-03-08 Thread Dieter Maurer
[EMAIL PROTECTED] writes on 7 Mar 2006 08:14:47 -0800: > > > FirstName > LastName > > > > I am trying to do this with the following code: > > from SOAPpy import WSDL > server = WSDL.Proxy(m_url) > request = {'firstname': FirstName, > 'lastname': LastName} > s

Re: setattr() oddness

2010-01-17 Thread Dieter Maurer
Lie Ryan writes on Sat, 16 Jan 2010 19:37:29 +1100: > On 01/16/10 10:10, Sean DiZazzo wrote: > > Interesting. I can understand the "would take time" argument, but I > > don't see any legitimate use case for an attribute only accessible via > > getattr(). Well, at least not a pythonic use case. >

Re: setattr() oddness

2010-01-19 Thread Dieter Maurer
Steven D'Aprano writes on 18 Jan 2010 06:47:59 GMT: > On Mon, 18 Jan 2010 07:25:58 +0100, Dieter Maurer wrote: > > > Lie Ryan writes on Sat, 16 Jan 2010 19:37:29 +1100: > >> On 01/16/10 10:10, Sean DiZazzo wrote: > >> > Interesting. I can understand

Re: Memory usage problem of twisted server

2010-01-21 Thread Dieter Maurer
Victor Lin writes on Wed, 20 Jan 2010 02:52:25 -0800 (PST): > Hi, > > I encountered an increasing memory usage problem of my twisted server. > I have posted a question on stackoverflow: > http://stackoverflow.com/questions/2100192/how-to-find-the-source-of-increasing-memory-usage-of-a-twisted-ser

Re: Things to know about super (was: super() and multiple inheritance failure)

2009-09-27 Thread Dieter Maurer
Michele Simionato writes on Fri, 25 Sep 2009 22:58:32 -0700 (PDT): > ... >You know that in an ideal world I would just > throw > away multiple inheritance, it is just not worth the complication. I am a fan of multiple inheritance: it lets the compliler/language runtime do stupid tasks (implement

Re: python performance on Solaris

2009-10-16 Thread Dieter Maurer
Antoine Pitrou writes on Thu, 15 Oct 2009 16:25:43 + (UTC): > Le Wed, 14 Oct 2009 22:39:14 -0700, John Nagle a écrit : > > > > Note that multithreaded compute-bound Python programs really suck > > on multiprocessors. Adding a second CPU makes the program go slower, > > due to a lame mec

Re: restriction on sum: intentional bug?

2009-10-17 Thread Dieter Maurer
Christian Heimes writes on Fri, 16 Oct 2009 17:58:29 +0200: > Alan G Isaac schrieb: > > I expected this to be fixed in Python 3: > > > sum(['ab','cd'],'') > > Traceback (most recent call last): > >File "", line 1, in > > TypeError: sum() can't sum strings [use ''.join(seq) instead] > >

[OT] Supporting "homework" (was: Re: Checking a Number for Palindromic Behavior)

2009-10-22 Thread Dieter Maurer
Steven D'Aprano writes on 20 Oct 2009 05:35:18 GMT: > As far as I'm concerned, asking for help on homework without being honest > up-front about it and making an effort first, is cheating by breaking the > social contract. Anyone who rewards cheaters by giving them the answer > they want is pa

Re: Python 2.6 Deprecation Warnings with __new__ Can someone explain why?

2009-10-24 Thread Dieter Maurer
Terry Reedy writes on Fri, 23 Oct 2009 03:04:41 -0400: > Consider this: > > def blackhole(*args, **kwds): pass > > The fact that it accept args that it ignores could be considered > misleading or even a bug. Maybe, it could. But, it is by no means necessary. In mathematics, there is a set of i

<    1   2   3   4   >