Re: sre_constants MODIFIED CLASS - ERROR

2022-06-25 Thread נתי שטרן
correction: This is CPYTHON * and not * CYTHON https://github.com/python/cpython/blob/3.10/Lib/sre_constants.py ‫בתאריך שבת, 25 ביוני 2022 ב-3:27 מאת ‪Dennis Lee Bieber‬‏ <‪ wlfr...@ix.netcom.com‬‏>:‬ > On Fri, 24 Jun 2022 18:27:33 +0300, ??? declaimed > the following: > > >I copied most

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Dennis Lee Bieber
On Fri, 24 Jun 2022 18:27:33 +0300, ??? declaimed the following: >I copied most of the libraries from cython I doubt that... cython is a specialized Python COMPILER system. "CPython" is the common interpreted Python language (implemented in C), and is the most likely source of the

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Dennis Lee Bieber
On Fri, 24 Jun 2022 15:14:50 +0300, ??? declaimed the following: >My TARGET is to bind many code libraries to one Huge code file that works >optimally and do optimizations if needed. >In this file have code of huge part of falconpy, ALL code of re, argparse, >are and many other code librari

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
I copied most of the libraries from cython בתאריך יום ו׳, 24 ביוני 2022, 17:18, מאת Roel Schroeven ‏< r...@roelschroeven.net>: > Op 24/06/2022 om 14:14 schreef נתי שטרן: > > My TARGET is to bind many code libraries to one Huge code file that > > works optimally and do optimizations if needed. >

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Roel Schroeven
Op 24/06/2022 om 14:14 schreef נתי שטרן: My TARGET  is to bind many code libraries to one Huge code file that works optimally and do optimizations if needed. In this file have code of huge part of falconpy, ALL code of re, argparse, are and many other code libraries Don't do that. Sorry, it's ju

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
Where found the license of those libraries? P. S. The copied and modified code used only for internal use בתאריך יום ו׳, 24 ביוני 2022, 15:28, מאת Chris Angelico ‏: > ‪On Fri, 24 Jun 2022 at 22:16, ‫נתי שטרן‬‎ wrote:‬ > > > > My TARGET is to bind many code libraries to one Huge code file that

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Chris Angelico
‪On Fri, 24 Jun 2022 at 22:16, ‫נתי שטרן‬‎ wrote:‬ > > My TARGET is to bind many code libraries to one Huge code file that works > optimally and do optimizations if needed. > In this file have code of huge part of falconpy, ALL code of re, argparse, > are and many other code libraries > > This co

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
My TARGET is to bind many code libraries to one Huge code file that works optimally and do optimizations if needed. In this file have code of huge part of falconpy, ALL code of re, argparse, are and many other code libraries This code file is contained 10k lines of python code בתאריך יום ו׳, 2

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Roel Schroeven
Op 24/06/2022 om 11:10 schreef נתי שטרן: OK. I lifted the full library to a HUGE python file that was saved on LAN in MY WORK Do I need to lift many other libraries to the file? I glad to any answer Answer this: what is it that your _actually_ trying to do? What is the ultimate goal of all that

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
OK. I lifted the full library to a HUGE python file that was saved on LAN in MY WORK Do I need to lift many other libraries to the file? I glad to any answer -- https://mail.python.org/mailman/listinfo/python-list

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Roel Schroeven
Op 24/06/2022 om 10:43 schreef נתי שטרן: what's the problem with the code Have you seen the replies from Mats Wichmann and Chris Angelico, who helpfully pointed out some problems with your code and possible improvements? Please take those into account instead of asking the same thing over

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
I did the changes on local copy of this code ‫בתאריך יום ו׳, 24 ביוני 2022 ב-11:50 מאת ‪Chris Angelico‬‏ <‪ ros...@gmail.com‬‏>:‬ > ‪On Fri, 24 Jun 2022 at 18:43, ‫נתי שטרן‬‎ wrote:‬ > > > > class _NamedIntConstant(int): > > def __new__(cls, value, name): > > self = super(_NamedIntCo

Re: sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread Chris Angelico
‪On Fri, 24 Jun 2022 at 18:43, ‫נתי שטרן‬‎ wrote:‬ > > class _NamedIntConstant(int): > def __new__(cls, value, name): > self = super(_NamedIntConstant, cls).__new__(cls, value) > self.name = name > return self > > def __repr__(self): > return self.name > >

sre_constants MODIFIED CLASS - ERROR

2022-06-24 Thread נתי שטרן
class _NamedIntConstant(int): def __new__(cls, value, name): self = super(_NamedIntConstant, cls).__new__(cls, value) self.name = name return self def __repr__(self): return self.name __reduce__ = None MAXREPEAT = _NamedIntConstant(32,name=str(32)) wh

Re: Class - error return

2016-09-06 Thread Smith
From: Smith On 06/09/2016 11:23, Peter Otten wrote: > If so look at > >> > ...: def __str__(self): >> > ...: return "Visitor: %i, Contacts: %i % >> > (self.visits,self.contacts)" > once more. Where are the quotes? Where should the be? > > > I solved the problem. thank you Pe

Re: Class - error return

2016-09-06 Thread nospam . Smith
On 06/09/2016 11:23, Peter Otten wrote: > If so look at > >> > ...: def __str__(self): >> > ...: return "Visitor: %i, Contacts: %i % >> > (self.visits,self.contacts)" > once more. Where are the quotes? Where should the be? > > > I solved the problem. thank you Peter -- https

Re: Class - error return

2016-09-06 Thread Smith
On 06/09/2016 11:23, Peter Otten wrote: If so look at > ...: def __str__(self): > ...: return "Visitor: %i, Contacts: %i % > (self.visits,self.contacts)" once more. Where are the quotes? Where should the be? I solved the problem. thank you Peter -- https://mail.python

Re: Class - error return

2016-09-06 Thread Peter Otten
Smith wrote: > you can help me ? Yes ;) But you might consider posting on python-tutor instead of python- list. > I can not understand where is the error in this script. It's always a good idea to state both what you expect and what you get instead explicitly, in plain english. > In [72]: day

Class - error return

2016-09-06 Thread Smith
Hi, you can help me ? I can not understand where is the error in this script. Use Python3. In [71]: class Day(object): ...: def __init__(self,visits,contacts): ...: self.visits = visits ...: self.contacts = contacts ...: def __add__(self,other): ...:

Re: class error

2011-03-21 Thread Jean-Michel Pichavant
monkeys paw wrote: OK, i overlooked that and the error was not very enlightening. Thanks very much. "module.__init__() takes at most 2 arguments (3 given)" Are you sure about the clueless error message ? :) JM -- http://mail.python.org/mailman/listinfo/python-list

Re: class error

2011-03-19 Thread Steven D'Aprano
On Sun, 20 Mar 2011 00:08:16 +, Rhodri James wrote: > It has to be said that the confusion is exacerbated by ignoring PEP-8 > and using the same (CamelCase) name for the module and the class. That > does provide a rich source of errors in cases like this. It's not so much that UserDict ignore

Re: class error

2011-03-19 Thread Rhodri James
On Sat, 19 Mar 2011 02:15:55 -, Terry Reedy wrote: On 3/18/2011 5:27 PM, monkeys paw wrote: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) OK, i overlooked that and the error was not very enlightening. A detailed explanation: ever

Re: class error

2011-03-18 Thread Terry Reedy
On 3/18/2011 5:27 PM, monkeys paw wrote: TypeError: Error when calling the metaclass bases module.__init__() takes at most 2 arguments (3 given) OK, i overlooked that and the error was not very enlightening. A detailed explanation: every module is an instance of a class we will call Module. E

Re: class error

2011-03-18 Thread monkeys paw
On 3/18/2011 4:43 PM, Alexander Kapps wrote: On 18.03.2011 21:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict After this import statement, the name "UserDict" refers to the module. class FileInfo(UserDict): Here you are trying to subclass the module. What y

Re: class error

2011-03-18 Thread Alexander Kapps
On 18.03.2011 21:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict After this import statement, the name "UserDict" refers to the module. class FileInfo(UserDict): Here you are trying to subclass the module. What you need instead is: class FileInfo(UserDict.U

Re: class error

2011-03-18 Thread Ethan Furman
monkeys paw wrote: I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): "store file metadata" def __init__(self, filename=None): UserDict.__init__(self) self["name"] = filename When i import it like so: import FileInfo i get this error

Re: class error

2011-03-18 Thread MRAB
On 18/03/2011 20:13, monkeys paw wrote: I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): "store file metadata" def __init__(self, filename=None): UserDict.__init__(self) self["name"] = filename When i import it like so: import FileIn

class error

2011-03-18 Thread monkeys paw
I have the following file: FileInfo.py: import UserDict class FileInfo(UserDict): "store file metadata" def __init__(self, filename=None): UserDict.__init__(self) self["name"] = filename When i import it like so: import FileInfo i get this e

Re: Mixin class error

2006-03-06 Thread Kent Johnson
Ed Leafe wrote: > On Mar 6, 2006, at 8:08 PM, Kent Johnson wrote: >> One workaround might be to use delegation instead of subclassing... > > Yeah, but that would involve a lot more work at this point. The > mixin approach has been working quite well up until this problem. Automatic delegati

Re: Mixin class error

2006-03-06 Thread Ed Leafe
On Mar 6, 2006, at 8:08 PM, Kent Johnson wrote: > I have no clue but googling 'type is not an acceptable base type' > finds > this thread > http://groups.google.com/group/comp.lang.python/browse_thread/ > thread/628b8ad34a36db17/579f716b143f4967%23579f716b143f4967? > sa=X&oi=groupsr&start=0&nu

Re: Mixin class error

2006-03-06 Thread Kent Johnson
Ed Leafe wrote: > In Dabo, we create cursor classes that combine the backend-specific > dbapi cursor class with our own mixin class that adds framework- > specific behaviors. This has been working well for a couple of years > now with many different backends, but today I'm getting errors w

Mixin class error

2006-03-06 Thread Ed Leafe
In Dabo, we create cursor classes that combine the backend-specific dbapi cursor class with our own mixin class that adds framework- specific behaviors. This has been working well for a couple of years now with many different backends, but today I'm getting errors with our Firebird c