Re: Is it dangeous when using custom metaclass?

2018-10-15 Thread Gregory Ewing
jf...@ms4.hinet.net wrote: class Structure(metaclass=StructureMeta): ... class PolyHeader(Structure): ... As my understanding, the metaclass's __init__ was called when a class was created. In the above example, both the Structure and PolyHeader called it. My question is: because the PolyHeader

Re: ESR "Waning of Python" post

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 4:18 PM dieter wrote: > > Marko Rauhamaa writes: > > Or you could blame the parts of the software that create too many > > long-term objects. > > I do not do that because I understand why in my application > there are many long living objects. > > > You shouldn't blame the

Re: Email parsing and unicode/utf8

2018-10-15 Thread dieter
Thomas Jollans writes: > I just stumbled over some curious behaviour of the stdlib email parsing > APIs which accept strings rather than bytes. It appears that you can't > parse an 8-bit UTF-8 message you have as a str without first encoding it. The primary purpose of an email parser is likely th

Re: ESR "Waning of Python" post

2018-10-15 Thread dieter
Marko Rauhamaa writes: > dieter : >> Marko Rauhamaa writes: >>> Keeping the number of long-term objects low is key. >> >> Right, if I need near realtime behaviour and must live >> with [C]Python's garbage collector. > > Or any other GC ever invented. There are "realtime garbage collection" algor

Is it dangeous when using custom metaclass?

2018-10-15 Thread jfong
class StructureMeta(type): def __init__(self, clsname, bases, clsdict): offset = 0 ... ... setattr(self, 'struct_size', offset) class Structure(metaclass=StructureMeta): ... ... class PolyHeader(Structure): ... ... As my understanding, the meta

Re: Python indentation (3 spaces)

2018-10-15 Thread Ethan Furman
On 10/15/2018 12:37 PM, Chris Angelico wrote: On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: Spaces that replaced a tab by accident, are easy to catch too. They are all those lines that show up when you do a diff with the previous ve

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 9:16 AM D'Arcy Cain wrote: > > On 10/15/18 5:54 PM, Gregory Ewing wrote: > > Cameron Simpson wrote: > >> I can't express how pleasing it is to see the traditional vi-vs-emacs > >> wars supplanted by emacs-vs-emacs :-) > > > > We're the People's Front of Emacs, not the Emacs

Re: Python indentation (3 spaces)

2018-10-15 Thread D'Arcy Cain
On 10/15/18 5:54 PM, Gregory Ewing wrote: > Cameron Simpson wrote: >> I can't express how pleasing it is to see the traditional vi-vs-emacs >> wars supplanted by emacs-vs-emacs :-) > > We're the People's Front of Emacs, not the Emacs People's Front! I thought we were the People's Emacs Front. --

Re: Python indentation (3 spaces)

2018-10-15 Thread Gregory Ewing
Cameron Simpson wrote: I can't express how pleasing it is to see the traditional vi-vs-emacs wars supplanted by emacs-vs-emacs :-) We're the People's Front of Emacs, not the Emacs People's Front! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Email parsing and unicode/utf8

2018-10-15 Thread Thomas Jollans
Hi, I just stumbled over some curious behaviour of the stdlib email parsing APIs which accept strings rather than bytes. It appears that you can't parse an 8-bit UTF-8 message you have as a str without first encoding it. The docs

pipenv and wheel/pre-compiled packages

2018-10-15 Thread Florian Pelgrim
Hi there, I'm currently using a buildhost for third party packages running ``` $ pip3 wheel --wheel-dir=/root/wheelhouse -r /requirements.txt ``` After successful build I copy the directory `/root/wheelhouse` onto a new machine and install the compiled packages by running ``` $ pip3 install

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 8:03 AM Cameron Simpson wrote: > > > [ Marko and Rhdri discussing emacs indentation modes ... ] > > I can't express how pleasing it is to see the traditional vi-vs-emacs > wars supplanted by emacs-vs-emacs :-) > Which editor should I use - vi in emacs mode, or emacs in vi

Re: Python indentation (3 spaces)

2018-10-15 Thread Cameron Simpson
[ Marko and Rhdri discussing emacs indentation modes ... ] I can't express how pleasing it is to see the traditional vi-vs-emacs wars supplanted by emacs-vs-emacs :-) Cheers, Cameron Simpson -- https://mail.python.org/mailman/listinfo/python-list

Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer wrote: > > On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > > On 13-10-18 09:37, Peter J. Holzer wrote: > > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > > >> On 08-10-18 19:43, Peter J. Holzer wrote: > > >>> In practice it doesn't work

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote: > On 13-10-18 09:37, Peter J. Holzer wrote: > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: > >> On 08-10-18 19:43, Peter J. Holzer wrote: > >>> In practice it doesn't work in my experience. There is always someone in > >>> a team who was "j

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 12:06:06 +0100, Rhodri James wrote: > On 14/10/18 09:06, Peter J. Holzer wrote: > > If everybody used tabs, why would anyone care about your tab width? > > Unless they look over your shoulder while you are typing, they won't > > even know how wide your tabs are. > > If you used two-s

Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 09:49:12 +1100, Cameron Simpson wrote: > On 15Oct2018 00:33, Peter J. Holzer wrote: > > On 2018-10-15 09:06:11 +1100, Chris Angelico wrote: > > > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: > > > > Chris Angelico : > > > > > Tabs for indentation have semantic meaning. Top-

RE: Single DB connection during class's lifetime. Metaclass,singletonand __new__() examples and references.

2018-10-15 Thread Ryan Johnson
Thank you. That clears everything up. Sent from Mail for Windows 10 From: Cameron Simpson Sent: Saturday, October 13, 2018 6:06 PM To: Ryan Johnson Cc: python-list@python.org Subject: Re: Single DB connection during class's lifetime. Metaclass,singletonand __new__() examples and references. On

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 16:41, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 12:28, Marko Rauhamaa wrote: Try running emacs -q abc.c and observe the indentation depth. """User Option: c-basic-offset This style variable holds the basic offset between indentation levels. It's factory defa

Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-15 Thread pjmclenon
On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote: > On 2018-10-14 00:13, pjmcle...@gmail.com wrote: > > On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote: > >> ​> 1st is this script is from a library module online open source > >> > >> If it's open source, why didn't

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Rhodri James : > On 15/10/18 12:28, Marko Rauhamaa wrote: >> Try running >> >> emacs -q abc.c >> >> and observe the indentation depth. > > """User Option: c-basic-offset > > This style variable holds the basic offset between indentation > levels. It's factory default is 4, but all the bui

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 12:28, Marko Rauhamaa wrote: Rhodri James : On 15/10/18 05:45, Marko Rauhamaa wrote: The two-space indentation is the out-of-the-box default for emacs. Ahem. It's the default for certain C styles. It's not even the default for C-mode itself, which is 4. You must be running a

Re: Python indentation (3 spaces)

2018-10-15 Thread Antoon Pardon
On 13-10-18 09:37, Peter J. Holzer wrote: > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote: >> On 08-10-18 19:43, Peter J. Holzer wrote: >>> On 2018-10-08 10:36:21 +1100, Chris Angelico wrote: How wide my indents are on my screen shouldn't influence your screen or your choices. >>> The

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Rhodri James : > On 15/10/18 05:45, Marko Rauhamaa wrote: >> The two-space indentation is the out-of-the-box default for emacs. > > Ahem. It's the default for certain C styles. It's not even the default > for C-mode itself, which is 4. You must be running a different version of emacs than all t

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 15/10/18 05:45, Marko Rauhamaa wrote: Chris Angelico : I'm saying I have never seen is this: On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa wrote: However, it is trumped by an older convention whereby the indentation levels go as follows: 0: 1: SPC SPC 2: SPC SPC SPC SPC 3

Re: ESR "Waning of Python" post

2018-10-15 Thread Marko Rauhamaa
dieter : > Marko Rauhamaa writes: >> Keeping the number of long-term objects low is key. > > Right, if I need near realtime behaviour and must live > with [C]Python's garbage collector. Or any other GC ever invented. > But, a web application does usually not need near realtime behaviour. > An o

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James
On 14/10/18 09:06, Peter J. Holzer wrote: On 2018-10-14 00:45:49 +, Grant Edwards wrote: On 2018-10-13, Peter J. Holzer wrote: For "just use tabs" to work, all of those tools would have to magically recognize that they're looking at Python source and adjust the tab size accordingly. Tha

Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Chris Angelico : > On Mon, Oct 15, 2018 at 3:51 PM Marko Rauhamaa wrote: > I don't understand your point here. It prints a letter, then some > spaces, then a tab, then another letter. On my terminal, that displays > the tab by advancing to the next tab position. If I highlight to > select, it's o

Python-Verilog (PyHDI-Pyverilog)

2018-10-15 Thread Bobby
I am working on my own domain-specific language (DSL). The DSL is based on functional requirements of a device under test (DUT). The grammar has rules like 'if' and 'else'. I have made a grammar of my DSL without any programming code in my grammar. I am using ANTLR to generate Parser, Lexer,

Python-Verilog (Pyverilog)

2018-10-15 Thread Bobby
I am working on my own domain-specific language (DSL). The DSL is based on functional requirements of a device under test (DUT). The grammar has rules like 'if' and 'else'. I have made a grammar of my DSL without any programming code in my grammar. I am using ANTLR to generate Parser, Lexer, Vis