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

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

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

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

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 בתאריך יום ו׳,

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

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 =

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))

[issue34331] Incorrectly pluralized abstract class error message

2019-09-11 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Thank you for your contribution -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.8 ___ Python tracker

[issue34331] Incorrectly pluralized abstract class error message

2019-09-11 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: New changeset 4a12a178f4a6b9a59d97fecc727f2b6b28dfc85f by Stéphane Wirtel (Daniel Andrade) in branch 'master': bpo-34331: Fix incorrectly pluralized abstract class error message. (GH-8670) https://github.com/python/cpython/commit

[issue34331] Incorrectly pluralized abstract class error message

2019-08-09 Thread Sanyam Khurana
Sanyam Khurana added the comment: Adding 3.9 to this bug. I've reviewed the PR and it looks good to me. -- nosy: +CuriousLearner versions: +Python 3.9 ___ Python tracker ___

[issue34331] Incorrectly pluralized abstract class error message

2018-08-04 Thread Daniel Andrade Groppe
Change by Daniel Andrade Groppe : -- keywords: +patch pull_requests: +8162 stage: -> patch review ___ Python tracker ___ ___

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread Eric V. Smith
Eric V. Smith added the comment: Actually, this one is probably easier to fix. In my opinion, #34127 is more important to fix, since it's seen much more often than the message about abstract base classes. I wouldn't necessarily object to fixing this one, I just personally think it's not

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread ppperry
ppperry added the comment: No, this isn't causing me an actual problem, however the related issue34127 was accepted, and this one should be no harder to fix. -- ___ Python tracker

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread Eric V. Smith
Eric V. Smith added the comment: I'm not sure the effort and code is justified for a trivial fix to an error message. Is this causing some actual problem? -- nosy: +eric.smith type: -> behavior ___ Python tracker

[issue34331] Incorrectly pluralized abstract class error message

2018-08-03 Thread ppperry
eedy, xtreak priority: normal severity: normal status: open title: Incorrectly pluralized abstract class error message versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue34331> ___

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

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 --

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 --

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]:

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): ...:

[issue21227] Decimal class error messages for integer division aren't good

2014-10-14 Thread Stefan Krah
Stefan Krah added the comment: I guess there's not much to be done here. -- resolution: - wont fix stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21227

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: It is hard to get fine grained error messages in _decimal, since the errors come from libmpdec. A clean solution would require changes to libmpdec, and I'm reluctant to do that right now. It is certainly possible to document DivisionImpossible etc. --

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: Meanwhile, the pure Python decimal versions prior to Python 3.2 have better error messages. Right now in Python 3.3+ it is hard to import the Python version without going into contortions, but that may be fixed in #19232. -- dependencies: +Speed up

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread leewz
leewz added the comment: Fine grained? Do you mean that the error can't be distinguished from other such errors? Or that it's difficult to attach the message to DivisionError? I thought DivisionError was always about precision. I looked up the error in libmpdec: This occurs and signals

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: My apologies if that wasn't clear: fine grained refers to the exception messages. A function can raise InvalidOperation for different reasons. decimal.py gives a specific error message in each case. libmpdec just signals the standard conforming InvalidOperation.

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread leewz
leewz added the comment: Nah. I found it surprising at first, but like I said, it's like the computer is given the first 28 digits of a number and then asked to figure out the 30th digit. What I'm confused about is how it fits the definition of division impossible given by libmpdec's docs

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: In the case of DivisionImpossible it would actually be possible to use the error message 'quotient too large in //, % or divmod'. But that's just one condition. In the case of InvalidOperation there are something like 30 different error messages. --

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: It is certainly possible to document DivisionImpossible etc. This should not be done. We've made strong efforts to not extend the Decimal Arithmetic Specification. Also, the API already suffers from high complexity. Adding more exceptions to the mix

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: Raymond Hettinger rep...@bugs.python.org wrote: It is certainly possible to document DivisionImpossible etc. This should not be done. We've made strong efforts to not extend the Decimal Arithmetic Specification. The exceptions are already there: Python

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21227 ___ ___

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread leewz
leewz added the comment: Total list of issues now: - Error message for `DivisionImpossible` is [class 'decimal.DivisionImpossible'] instead of an actual error message. - `decimal.DivisionImpossible.__doc__` is empty. - Calling `help(decimal.DivisionImpossible)` turns up nothing useful.

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: leewz rep...@bugs.python.org wrote: - Error message for `DivisionImpossible` is [class 'decimal.DivisionImpossible'] instead of an actual error message. No, the error message for the *signal* that is raised (InvalidOperation) lists the *condition* that

[issue21227] Decimal class error messages for integer division aren't good

2014-04-16 Thread Stefan Krah
Stefan Krah added the comment: The idea behind the list as the exception message is this: If multiple conditions would have raised the signal they are all listed, while the highest ranking signal is the one that is ultimately raised. from decimal import * c = getcontext() for v in c.traps:

[issue21227] Decimal class error messages for integer division aren't good

2014-04-15 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- assignee: docs@python - skrah nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21227 ___

[issue21227] Decimal class error messages for integer division aren't good

2014-04-14 Thread leewz
severity: normal status: open title: Decimal class error messages for integer division aren't good type: enhancement versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21227

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-20 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 ignores

Re: class error

2011-03-19 Thread Rhodri James
On Sat, 19 Mar 2011 02:15:55 -, Terry Reedy tjre...@udel.edu 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

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

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 FileInfo

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 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

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

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.

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

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 with

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=Xoi=groupsrstart=0num=3

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 delegation is