• sre_constants MODIFIED CLASS - ERROR

    From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 11:43:19 2022
    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))

    what's the problem with the code????

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roel Schroeven@21:1/5 to All on Fri Jun 24 11:01:14 2022
    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 and over.

    --
    "Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
    "Perfectie is niet bereikt als er niets meer toe te voegen is, maar als er niets meer weg te nemen is."
    -- Antoine de Saint-Exupéry

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to nsh531@gmail.com on Fri Jun 24 18:48:25 2022
    ‪On Fri, 24 Jun 2022 at 18:43, ‫נתי שטרן‬‎ <nsh531@gmail.com> 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

    __reduce__ = None
    MAXREPEAT = _NamedIntConstant(32,name=str(32))

    what's the problem with the code????

    You ripped a bunch of code from the standard library without
    understanding what it does, and now it doesn't work. The problem is
    more with your methodology than your code.

    Why are you doing this? Why not simply use what's there?

    If you REALLY need to make source-level changes, make *changes*, don't
    try to lift small parts out. Also, you will need to spend some hours
    getting to know the code that you're mutating.

    Is there an alternative newsgroup for lazy-python-users-who-dont-want-to-do-the-work@groups.google.com ?

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 11:55:49 2022
    I did the changes on local copy of this code

    ‫בתאריך יום ו׳, 24 ביוני 2022 ב-11:50 מאת ‪Chris Angelico‬‏ <‪
    rosuav@gmail.com‬‏>:‬

    ‪On Fri, 24 Jun 2022 at 18:43, ‫נתי שטרן‬‎ <nsh531@gmail.com> 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

    __reduce__ = None
    MAXREPEAT = _NamedIntConstant(32,name=str(32))

    what's the problem with the code????

    You ripped a bunch of code from the standard library without
    understanding what it does, and now it doesn't work. The problem is
    more with your methodology than your code.

    Why are you doing this? Why not simply use what's there?

    If you REALLY need to make source-level changes, make *changes*, don't
    try to lift small parts out. Also, you will need to spend some hours
    getting to know the code that you're mutating.

    Is there an alternative newsgroup for lazy-python-users-who-dont-want-to-do-the-work@groups.google.com ?

    ChrisA
    --
    https://mail.python.org/mailman/listinfo/python-list



    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 12:10:21 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 15:14:50 2022
    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



    בתאריך יום ו׳, 24 ביוני 2022, 14:37, מאת Roel Schroeven ‏< roel@roelschroeven.net>:

    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 copying and changing? Cause there is almost
    always a better and easier way.

    --
    "You can fool some of the people all the time, and all of the people some
    of the time, but you cannot fool all of the people all of the time."
    -- Abraham Lincoln
    "You can fool too many of the people too much of the time."
    -- James Thurber

    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roel Schroeven@21:1/5 to All on Fri Jun 24 13:34:06 2022
    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 copying and changing? Cause there is almost
    always a better and easier way.

    --
    "You can fool some of the people all the time, and all of the people some
    of the time, but you cannot fool all of the people all of the time."
    -- Abraham Lincoln
    "You can fool too many of the people too much of the time."
    -- James Thurber

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Chris Angelico@21:1/5 to nsh531@gmail.com on Fri Jun 24 22:26:23 2022
    ‪On Fri, 24 Jun 2022 at 22:16, ‫נתי שטרן‬‎ <nsh531@gmail.com> 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 code file is contained 10k lines of python code


    Did you check the license terms of all of those libraries? Are you
    even legally allowed to do that?

    ChrisA

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 15:41:58 2022
    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 ‏<rosuav@gmail.com>:

    ‪On Fri, 24 Jun 2022 at 22:16, ‫נתי שטרן‬‎ <nsh531@gmail.com> 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 code file is contained 10k lines of python code


    Did you check the license terms of all of those libraries? Are you
    even legally allowed to do that?

    ChrisA
    --
    https://mail.python.org/mailman/listinfo/python-list


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Roel Schroeven@21:1/5 to All on Fri Jun 24 16:18:35 2022
    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 just as simple as that. Don't do that. All
    those modules are not designed to put together like that, all their
    namespaces merged together. Don't do it.
    Even if you could eventually get it to work, it would not be any more
    optimal.

    If you need more performance, look into things like Pypy or Cython.

    --
    "Experience is that marvelous thing that enables you to recognize a
    mistake when you make it again."
    -- Franklin P. Jones

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Fri Jun 24 18:27:33 2022
    I copied most of the libraries from cython
    בתאריך יום ו׳, 24 ביוני 2022, 17:18, מאת Roel Schroeven ‏< roel@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.
    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 just as simple as that. Don't do that. All
    those modules are not designed to put together like that, all their namespaces merged together. Don't do it.
    Even if you could eventually get it to work, it would not be any more optimal.

    If you need more performance, look into things like Pypy or Cython.

    --
    "Experience is that marvelous thing that enables you to recognize a
    mistake when you make it again."
    -- Franklin P. Jones



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dennis Lee Bieber@21:1/5 to All on Fri Jun 24 14:19:00 2022
    On Fri, 24 Jun 2022 15:14:50 +0300, ??? ???? <nsh531@gmail.com> 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 libraries

    This code file is contained 10k lines of python code


    Which means any program that just uses regular expressions has to import, parse, and byte-code compile all 10K lines.

    There is a reason Python doesn't make super all-in-one libraries.


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dennis Lee Bieber@21:1/5 to All on Fri Jun 24 14:28:13 2022
    On Fri, 24 Jun 2022 18:27:33 +0300, ??? ???? <nsh531@gmail.com> 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 packages you are mongrelizing..

    https://cython.org/
    """
    Cython is an optimising static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes writing C extensions for Python as easy as Python itself.
    """
    """
    The Cython language is a superset of the Python language that additionally supports calling C functions and declaring C types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code. The C code is generated once and then compiles with all major C/C++ compilers in CPython 2.6, 2.7 (2.4+ with Cython 0.20.x) as well as
    3.3 and all later versions.
    """


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?B?16DXqteZINep15jXqNef?=@21:1/5 to All on Sat Jun 25 21:51:49 2022
    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‬‏ <‪
    wlfraed@ix.netcom.com‬‏>:‬

    On Fri, 24 Jun 2022 18:27:33 +0300, ??? ???? <nsh531@gmail.com> 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 packages you are mongrelizing..

    https://cython.org/
    """
    Cython is an optimising static compiler for both the Python programming language and the extended Cython programming language (based on Pyrex). It makes writing C extensions for Python as easy as Python itself.
    """
    """
    The Cython language is a superset of the Python language that additionally supports calling C functions and declaring C types on variables and class attributes. This allows the compiler to generate very efficient C code from Cython code. The C code is generated once and then compiles with all major C/C++ compilers in CPython 2.6, 2.7 (2.4+ with Cython 0.20.x) as well as
    3.3 and all later versions.
    """


    --
    Wulfraed Dennis Lee Bieber AF6VN
    wlfraed@ix.netcom.com
    http://wlfraed.microdiversity.freeddns.org/
    --
    https://mail.python.org/mailman/listinfo/python-list



    --
    <https://netanel.ml>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)