sibly non-pythonic topic and go read another book or a few hundred so
when it comes up again ...
-Original Message-
From: Python-list On
Behalf Of Thomas Passin
Sent: Saturday, March 4, 2023 5:04 PM
To: python-list@python.org
Subject: Re: Which more Pythonic - self.__class__ or type(self)
Nope. No consensus.
I’d use self.__class__ . Seems more explicit and direct to me.
From: Python-list on
behalf of Ian Pilcher
Date: Thursday, March 2, 2023 at 4:17 PM
To: python-list@python.org
Subject: Which more Pythonic - self.__class__ or type(self)?
*** Attention: This is an external ema
t: Saturday, March 4, 2023 1:09 PM
To: python-list@python.org
Subject: Re: Which more Pythonic - self.__class__ or type(self)?
On 3/4/2023 2:47 AM, Peter J. Holzer wrote:
Even before Python existed there was the adage "a real programmer
can write FORTRAN in any language", indicating that id
it becomes an
exotic addition to Python in a way that loosely melds, or if it becomes the
PYTHONIC way ...
-Original Message-
From: Alan Gauld
Sent: Saturday, March 4, 2023 1:38 PM
To: avi.e.gr...@gmail.com; python-list@python.org
Subject: Re: RE: Which more Pythonic - self.__class__ or t
native language(s).
I am sure some books along these lines have already been written!
Who wants to collaborate?
-Original Message-
From: Python-list On
Behalf Of dn via Python-list
Sent: Saturday, March 4, 2023 1:26 PM
To: python-list@python.org
Subject: Re: Which more Pythonic - self
on late and found an
expanding language with way too many ways to do anything and can choose. But
I claim that too is pythonic!
-Original Message-
From: Python-list On
Behalf Of Thomas Passin
Sent: Saturday, March 4, 2023 1:09 PM
To: python-list@python.org
Subject: Re: Which more Pythonic - se
On 2023-03-04 12:38:22 -0500, avi.e.gr...@gmail.com wrote:
> Of course each language has commonly used idioms as C with pointer
> arithmetic and code like *p++=*q++ but my point is that although I live near
> a seaway and from where C originated, I am not aware of words like "c-way"
> or "scenic"
On 04/03/2023 17:38, avi.e.gr...@gmail.com wrote:
>
> Of course each language has commonly used idioms
>
That's the point, the correct term is probably "idiomatic"
rather than "pythonic" but it is a defacto standard that
idiomatic Python has become known as Pythonic. I don't
think that's a prob
On 04/03/2023 20.47, Peter J. Holzer wrote:
On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote:
...
No. Even before Python existed there was the adage "a real programmer
can write FORTRAN in any language", indicating that idiomatic usage of a
language is not governed by syntax and libra
On 3/4/2023 2:47 AM, Peter J. Holzer wrote:
Even before Python existed there was the adage "a real programmer
can write FORTRAN in any language", indicating that idiomatic usage of a
language is not governed by syntax and library alone, but there is a
cultural element: People writing code in a sp
python-list@python.org
Subject: Re: Which more Pythonic - self.__class__ or type(self)?
On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote:
> I do not buy into any concept about something being pythonic or not.
>
> Python has grown too vast and innovated quite a bit, but als
On 2023-03-03 13:51:11 -0500, avi.e.gr...@gmail.com wrote:
> I do not buy into any concept about something being pythonic or not.
>
> Python has grown too vast and innovated quite a bit, but also borrowed from
> others and vice versa.
>
> There generally is no universally pythonic way nor should
On 4/03/23 7:51 am, avi.e.gr...@gmail.com wrote:
I leave you with the question of the day. Was Voldemort pythonic?
Well, he was fluent in Parseltongue, which is not a good sign.
I hope not, otherwise we'll have to rename Python to "The Language
That Shall Not Be Named" and watch out for horcr
means you should not care
about efficiency! LOL!
I leave you with the question of the day. Was Voldemort pythonic?
Avi
-Original Message-
From: Python-list On
Behalf Of Alan Gauld
Sent: Friday, March 3, 2023 4:43 AM
To: python-list@python.org
Subject: Re: Which more Pythonic - self.__class
On 3/3/23 03:32, Chris Angelico wrote:
> On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote:
>> On 02/03/2023 20:54, Ian Pilcher wrote:
>>> Seems like an FAQ, and I've found a few things on StackOverflow that
>>> discuss the technical differences in edge cases, but I haven't found
>>> anything that ta
On Fri, 3 Mar 2023 at 20:44, Alan Gauld wrote:
>
> On 02/03/2023 20:54, Ian Pilcher wrote:
> > Seems like an FAQ, and I've found a few things on StackOverflow that
> > discuss the technical differences in edge cases, but I haven't found
> > anything that talks about which form is considered to be
On 02/03/2023 20:54, Ian Pilcher wrote:
> Seems like an FAQ, and I've found a few things on StackOverflow that
> discuss the technical differences in edge cases, but I haven't found
> anything that talks about which form is considered to be more Pythonic
> in those situations where there's no funct
Subject: Re: Which more Pythonic - self.__class__ or type(self)?
On 3/2/2023 5:53 PM, Greg Ewing via Python-list wrote:
> On 3/03/23 9:54 am, Ian Pilcher wrote:
>> I haven't found
>> anything that talks about which form is considered to be more Pythonic
>> in those situations w
On 3/2/2023 5:53 PM, Greg Ewing via Python-list wrote:
On 3/03/23 9:54 am, Ian Pilcher wrote:
I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
In such cases I'd probably go for type(x), because it
On 3/03/23 9:54 am, Ian Pilcher wrote:
I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional difference.
In such cases I'd probably go for type(x), because it looks less
ugly.
x.__class__ *might* be slightly more
On 3/2/2023 3:54 PM, Ian Pilcher wrote:
Seems like an FAQ, and I've found a few things on StackOverflow that
discuss the technical differences in edge cases, but I haven't found
anything that talks about which form is considered to be more Pythonic
in those situations where there's no functional
Dear Mats,
thanks for the reply.
Am 19.09.2022 16:10 schrieb Mats Wichmann:
Kind of unrelated to the actual question, but if you start doing
anything serious under Travis you'll run out of free minutes rather
quickly. My project had to just give up on it after they changed
their licensing mode
On 9/18/22 03:46, c.bu...@posteo.jp wrote:
Hello,
I am using TravisCI for my project on GitHub. The project is packaged
for Debian, Ubuntu, Arch and several other distros.
All this distros support multiple architectures and they have their own
test machines to take care that all packages workin
I would depend on the project.
In the crytoanalysis tool that I developing, "cryptonita", I just
manipule bytes. Nothing that could depend on the distro so my CI picks
one OS and run the tests there.
Project: https://github.com/cryptonitas/cryptonita
CI:
https://github.com/cryptonitas/cryptonit
RSTUDIO
but they often come with many superfluous features and lots of complexity.
-Original Message-
From: Python-list On
Behalf Of Grant Edwards
Sent: Thursday, August 4, 2022 10:35 AM
To: python-list@python.org
Subject: Re: Which linux distro is more conducive for learning the Python
On 2022-08-04, Christian Heimes wrote:
> Fedora is an excellent choice for Python users. Fedora 36 already comes
> with Python 3.11.0b5 in its main repository. In fact you have Python
> 2.7, 3.5-3.11, PyPy 2.7, PyPy 3.7-3.9, and MicroPython at your fingertips.
Except that real programmers use
On 04/08/2022 20.12, Barry wrote:
Noted with thanks Kushal. Since I can download FREE copies of RHEL
9.0, I will use it then.
I consider rhel 9 is an old os. I would suggest using fedora over rhel.
Fedora 36 has python 3.10 and the when fedora 37 is released it will have
python 3.11.
And fedor
> On 4 Aug 2022, at 09:48, Turritopsis Dohrnii Teo En Ming
> wrote:
>
> On Thu, 4 Aug 2022 at 13:02, Kushal Kumaran wrote:
>>
>>> On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming
>>> wrote:
>>> Subject: Which linux distro is more conducive for learning the Python
>>> pr
On 8/3/22 19:01, Turritopsis Dohrnii Teo En Ming wrote:
Subject: Which linux distro is more conducive for learning the Python
programming language?
You might try Pythontu.
Not really. Get the distro that looks appealing to you.
One won't be better than the other with regard to learning
pytho
On 2022-08-04, Turritopsis Dohrnii Teo En Ming wrote:
> Subject: Which linux distro is more conducive for learning the Python
> programming language?
You can learn Python on any Linux distribution.
First answer this question:
* Whom are you going to ask for help when you run into Linux questi
Just be aware https://docs.python.org/3/ defaults to the latest Python version
(3.10). When looking up a module, it’s best to explicitly set the documentation
to the version you are using. It won’t matter the vast majority of the time but
I have been burned by trying to use a function or paramet
On Thu, 4 Aug 2022 at 16:50, dn wrote:
>
> >> PS most of us will qualify for RedHat's Developer program[me] and free
> >> copies of software.
> >
> > I can download free copies of RHEL 7.x, 8.x, and 9.x :) Just that I
> > dunno which RHEL version is better. Is RHEL 9.0 the best out of 7.x,
> > 8.x
>> PS most of us will qualify for RedHat's Developer program[me] and free
>> copies of software.
>
> I can download free copies of RHEL 7.x, 8.x, and 9.x :) Just that I
> dunno which RHEL version is better. Is RHEL 9.0 the best out of 7.x,
> 8.x and 9.x?
RedHat is a stable OpSys. Accordingly, it
On Thu, 4 Aug 2022 at 13:02, Kushal Kumaran wrote:
>
> On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming
> wrote:
> > Subject: Which linux distro is more conducive for learning the Python
> > programming language?
> >
> > Good day from Singapore,
> >
> > May I know which linux
On Thu, 4 Aug 2022 at 11:05, dn wrote:
>
> On 04/08/2022 14.31, Paul Bryan wrote:
> > I wouldn't say any particular Linux distribution is appreciably better
> > for Python development than another. I would suggest using a version of
> > a Linux distribution that supports a recent Python release (e
On Thu, 4 Aug 2022 at 10:47, orzodk wrote:
>
> Turritopsis Dohrnii Teo En Ming writes:
>
> > noted with thanks. I have been using Linux for more than 10 years already
>
> Ah, if you're familiar with Redhat (RPM) based distributions, consider
> Fedora as you will have access to newer versions soon
On Thu, Aug 04 2022 at 10:22:41 AM, Turritopsis Dohrnii Teo En Ming
wrote:
> Subject: Which linux distro is more conducive for learning the Python
> programming language?
>
> Good day from Singapore,
>
> May I know which linux distro is more conducive for learning the
> Python programming languag
On 04/08/2022 14.31, Paul Bryan wrote:
> I wouldn't say any particular Linux distribution is appreciably better
> for Python development than another. I would suggest using a version of
> a Linux distribution that supports a recent Python release (e.g. 3.9 or
> 3.10).
+1
As a Python-learner (ther
I actually did a Google search for "which linux distro is best for python".
Link:
https://www.google.com/search?q=which+linux+distro+is+best+for+python&rlz=1C1GCEA_enSG1005SG1005&sxsrf=ALiCzsYaL58MJsevR2Uc0nnWtmc7kWFbIg%3A1659580387580&ei=4y_rYqWII8i7z7sPwPCtwAI&ved=0ahUKEwjlhenbkqz5AhXI3XMBHUB4C
I wouldn't say any particular Linux distribution is appreciably better
for Python development than another. I would suggest using a version of
a Linux distribution that supports a recent Python release (e.g. 3.9 or
3.10).
On Thu, 2022-08-04 at 10:22 +0800, Turritopsis Dohrnii Teo En Ming
wrote:
>
On 2020-12-29, jak wrote:
>
> you could try this way:
>
> # ---
> from dns import resolver as dns
>
> emails=['john@fakeserver.bah',
> 'john@gmail.com']
>
> for ue in emails:
> try:
> mxl = dns.resolve(ue.split('@')[1], 'MX')
> except:
> print(f
Il 29/12/2020 02:48, Bischoop ha scritto:
On 2020-12-28, Mats Wichmann wrote:
On 12/28/20 10:46 AM, Marco Sulla wrote:
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
I'd like to check if there's "@" in a string and wondering if any method
is better/safer than others. I was told on one occasi
On 2020-12-28, Michael Torrie wrote:
> On 12/28/20 10:46 AM, Marco Sulla wrote:
>> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>>>
>>> I'd like to check if there's "@" in a string and wondering if any method
>>> is better/safer than others. I was told on one occasion that I should
>>> use is th
On 12/28/20 8:02 PM, Chris Angelico wrote:
>
> Yes, many such regexes exist, and they are *all wrong*. Without
> exception. I don't think it's actually possible for a regex to
> perfectly match all (syntactically) valid email addresses and nothing
> else.
>
> ChrisA
Since Email addresses are allow
On 2020-12-28, Mats Wichmann wrote:
> On 12/28/20 10:46 AM, Marco Sulla wrote:
>> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>>>
>>> I'd like to check if there's "@" in a string and wondering if any method
>>> is better/safer than others. I was told on one occasion that I should
>>> use is tha
.
Dropping out, ...
-Original Message-
From: Python-list On
Behalf Of Chris Angelico
Sent: Monday, December 28, 2020 8:02 PM
To: Python
Subject: Re: Which method to check if string index is queal to character.
On Tue, Dec 29, 2020 at 10:08 AM Avi Gross via Python-list
wrote:
>
> This
On Tue, Dec 29, 2020 at 10:08 AM Avi Gross via Python-list
wrote:
>
> This may be a nit, but can we agree all valid email addresses as used today
> have more than an @ symbol?
>
> I see it as requiring at least one character before the @ that come from a
> list of allowed characters (perhaps not A
: Python
Subject: Re: Which method to check if string index is queal to character.
On Tue, Dec 29, 2020 at 6:18 AM Bischoop wrote:
>
> On 2020-12-28, Stefan Ram wrote:
> >
> > "@" in s
> >
>
> That's what I thought.
>
> >>I want check if stri
On 12/28/20 1:27 PM, Richard Damon wrote:
> Validating that it meets the SYNTAX of an email address isn't THAT hard,
> but there are a number of edge cases to worry about.
Yes one would think that, but in my experience half of all web sites get
it wrong, insisting that my perfectly valid and RFC-c
On 2020-12-28, Bischoop wrote:
> On 2020-12-28, Stefan Ram wrote:
>>
>> "@" in s
>>
>
> That's what I thought.
>
>>>I want check if string is a valid email address.
>>
>> I suggest to first try and define "valid email address" in English.
>
> A valid email address consists of an email prefix
On 12/28/20 4:52 PM, Michael Torrie wrote:
> On 12/28/20 10:37 AM, Bischoop wrote:
>> A valid email address consists of an email prefix and an email domain,
>> both in acceptable formats. The prefix appears to the left of the @ symbol.
>> The domain appears to the right of the @ symbol.
>> For exam
On Tue, Dec 29, 2020 at 8:57 AM dn via Python-list
wrote:
> After such disparagement it is worth remembering that there are checks
> and there are checks! It depends upon the purpose of the check, or the
> level-of-detail/accuracy desired!
>
> When accepting user-data it *is* worth (even "necessar
On 28Dec2020 13:08, Mats Wichmann wrote:
>On 12/28/20 10:46 AM, Marco Sulla wrote:
>>On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>>>I'd like to check if there's "@" in a string and wondering if any
>>>method is better/safer than others.
Others have pointed out: '@' in s
>Will add that Yes, y
On 29/12/2020 09:27, Richard Damon wrote:
On 12/28/20 3:08 PM, Mats Wichmann wrote:
On 12/28/20 10:46 AM, Marco Sulla wrote:
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
...
but probably what you really want is a regular expression.
because...
Will add that Yes, you should always va
On 12/28/20 10:46 AM, Marco Sulla wrote:
> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>>
>> I'd like to check if there's "@" in a string and wondering if any method
>> is better/safer than others. I was told on one occasion that I should
>> use is than ==, so how would be on this example.
>>
>>
On 12/28/20 10:37 AM, Bischoop wrote:
> A valid email address consists of an email prefix and an email domain,
> both in acceptable formats. The prefix appears to the left of the @ symbol.
> The domain appears to the right of the @ symbol.
> For example, in the address exam...@mail.com, "example" i
On 12/28/20 3:08 PM, Mats Wichmann wrote:
> On 12/28/20 10:46 AM, Marco Sulla wrote:
>> On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>>>
>>> I'd like to check if there's "@" in a string and wondering if any
>>> method
>>> is better/safer than others. I was told on one occasion that I should
>>> u
On 12/28/20 10:46 AM, Marco Sulla wrote:
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
I'd like to check if there's "@" in a string and wondering if any method
is better/safer than others. I was told on one occasion that I should
use is than ==, so how would be on this example.
s = 't...@mail
On Tue, Dec 29, 2020 at 6:18 AM Bischoop wrote:
>
> On 2020-12-28, Stefan Ram wrote:
> >
> > "@" in s
> >
>
> That's what I thought.
>
> >>I want check if string is a valid email address.
> >
> > I suggest to first try and define "valid email address" in English.
> >
> >
>
> A valid email add
On 12/28/2020 11:31 AM, Bischoop wrote:
I'd like to check if there's "@" in a string
Use the obvious "'@' in string".
> and wondering if any method is better/safer than others.
Any special purpose method built into the language is likely to be
fastest. Safest? What danger are you worried a
On 2020-12-28, Stefan Ram wrote:
>
> "@" in s
>
That's what I thought.
>>I want check if string is a valid email address.
>
> I suggest to first try and define "valid email address" in English.
>
>
A valid email address consists of an email prefix and an email domain,
both in acceptable for
On 2020-12-28 16:31, Bischoop wrote:
I'd like to check if there's "@" in a string and wondering if any method
is better/safer than others. I was told on one occasion that I should
use is than ==, so how would be on this example.
[snip]
The shortest and quickest way to check whether "@" is in m
On Mon, 28 Dec 2020 at 17:37, Bischoop wrote:
>
> I'd like to check if there's "@" in a string and wondering if any method
> is better/safer than others. I was told on one occasion that I should
> use is than ==, so how would be on this example.
>
> s = 't...@mail.is'
You could do simply
if "@"
On 10/9/20 1:02 AM, Muhammad Saad wrote:
>
>
>
>
>Sent from [1]Mail for Windows 10
>
>I Want To Reinstall Python Now Which Version I Install Now
>
> References
>
>Visible links
>1. https://go.microsoft.com/fwlink/?LinkId=550986
>
The latest, 3.9, is as always consid
> Then, I can only download the older version 2016.2.3 for my old 32 bit
system:-(
You could always use VSCode with the Python extension instead:
https://code.visualstudio.com/Download. There's support for 32bit Windows
as long as you're on 7, 8, or 10. I haven't used it myself though, I most
use
Nick Sarbicki於 2019年8月20日星期二 UTC+8下午1時33分32秒寫道:
> Yes the community edition works fine.
>
> It seems to require a 64 bit version of Windows 7 or higher (I'm not sure
> as I haven't used Windows in years).
>
> On Tue, 20 Aug 2019, 03:27 , wrote:
>
> > Nick Sarbicki於 2019年8月19日星期一 UTC+8下午5時33分27秒
Sorry, I meant to trim the older portion :-(
Bev in TX
> On Aug 20, 2019, at 4:53 AM, Bev In TX wrote:
>
> Search for “Choose” (without the quote marks) on the following webpage to see
> the differences between the community and commercial versions:
> https://www.jetbrains.com/pycharm/features
Search for “Choose” (without the quote marks) on the following webpage to see
the differences between the community and commercial versions:
https://www.jetbrains.com/pycharm/features/
From the following webpage, “Microsoft Windows 7 SP1 or later”
https://www.jetbrains.com/help/pycharm/installati
Yes the community edition works fine.
It seems to require a 64 bit version of Windows 7 or higher (I'm not sure
as I haven't used Windows in years).
On Tue, 20 Aug 2019, 03:27 , wrote:
> Nick Sarbicki於 2019年8月19日星期一 UTC+8下午5時33分27秒寫道:
> > PyCharm takes you to the source code within the editor f
Nick Sarbicki於 2019年8月19日星期一 UTC+8下午5時33分27秒寫道:
> PyCharm takes you to the source code within the editor for any
> variables/functions/classes/modules if you ctrl+click on what you want to
> see. It allows you to browse the relevant bits of code quickly, as well as
> let you change them in your loc
> The most popular choices today are probably PyCharm and VSCode. I prefer
> vim with the syntastic plugin (and a few other plugins including Jedi),
but
> I've heard good things about the other two.
Personally, I've been using VSCode with the Python and Vim extensions. I've
used PyCharm as well a
Uh oh. Editor wars.
The most popular choices today are probably PyCharm and VSCode. I prefer
vim with the syntastic plugin (and a few other plugins including Jedi), but
I've heard good things about the other two. And emacs almost certainly can
edit/view Python files well, though I haven't heard
PyCharm takes you to the source code within the editor for any
variables/functions/classes/modules if you ctrl+click on what you want to
see. It allows you to browse the relevant bits of code quickly, as well as
let you change them in your local environment if need be.
That way you don't have to d
MRAB於 2019年6月18日星期二 UTC+8下午6時12分50秒寫道:
> On 2019-06-18 04:57, jf...@ms4.hinet.net wrote:
> > Terry Reedy於 2019年6月18日星期二 UTC+8上午11時03分00秒寫道:
> >> On 6/17/2019 10:54 PM, jf...@ms4.hinet.net wrote:
> >>
> >> > c:\Works\Python34>pip install windows-curses
> >> > DEPRECATION: Python 3.4 support has bee
On 2019-06-18 04:57, jf...@ms4.hinet.net wrote:
Terry Reedy於 2019年6月18日星期二 UTC+8上午11時03分00秒寫道:
On 6/17/2019 10:54 PM, jf...@ms4.hinet.net wrote:
> c:\Works\Python34>pip install windows-curses
> DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the
last one supporting it. Pl
Terry Reedy於 2019年6月18日星期二 UTC+8上午11時03分00秒寫道:
> On 6/17/2019 10:54 PM, jf...@ms4.hinet.net wrote:
>
> > c:\Works\Python34>pip install windows-curses
> > DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the
> > last one supporting it. Please upgrade your Python as Python 3.4
On 6/17/2019 10:54 PM, jf...@ms4.hinet.net wrote:
c:\Works\Python34>pip install windows-curses
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last
one supporting it. Please upgrade your Python as Python 3.4 w
on't be maintained after March 2019 (cf PEP 429).
Collectin
MRAB於 2019年6月18日星期二 UTC+8上午10時08分23秒寫道:
> On 2019-06-18 02:39, jf...@ms4.hinet.net wrote:
> > As many others had encountered, when I import the curses module under
> > Windows, I got
> >
> > ImportError: No module named '_curses'
> >
> > Search "curses" on the Pypi returns plenty of related
On 2019-06-18 02:39, jf...@ms4.hinet.net wrote:
As many others had encountered, when I import the curses module under Windows,
I got
ImportError: No module named '_curses'
Search "curses" on the Pypi returns plenty of related packages. Which one
should I use? Is this package still valid
Ben Finney writes:
> Ajay Patel writes:
>
> > L = [1,2,3]
>
> That's not an expression; it is an assignment statement.
>
> The right-hand side is an expression. […] in this case, [the object] a new
> instance of 'list' […] is the result of evaluating the right-hand side
> of the expression.
I g
Ajay Patel writes:
> L = [1,2,3]
That's not an expression; it is an assignment statement.
The right-hand side is an expression. It will (at the top level) create
a list.
To create a new instance of the 'list' type, Python will call the type's
'__new__' method. This is termed the constructor fo
On Fri, Sep 28, 2018 at 8:52 AM Ajay Patel wrote:
>
> Hello gauys,
>
> Which list class method will call for below codes?
>
> L = [1,2,3]
> And
> L =[]
None. Simple assignment does not call any methods. It just takes the
value on the right hand side and says, hey, "L", you now mean that
thing, k?
On 08Mar2018 20:25, C W wrote:
Thank you guys, lots of great answers, very helpful. I got it!
A follow-up question:
How did the value of "object" get passed to "time"? Obviously, they have
different names. How did Python make that connection?
Code is below for convenience.
class Clock(object
On Thu, 08 Mar 2018 20:25:42 -0500, C W wrote:
> Thank you guys, lots of great answers, very helpful. I got it!
>
> A follow-up question:
>
> How did the value of "object" get passed to "time"? Obviously, they have
> different names. How did Python make that connection?
It didn't. You have misu
Thank you guys, lots of great answers, very helpful. I got it!
A follow-up question:
How did the value of "object" get passed to "time"? Obviously, they have
different names. How did Python make that connection?
Code is below for convenience.
class Clock(object):
def __init__(self, time):
On Wed, 07 Mar 2018 16:57:51 -0500, C W wrote:
> Hello,
>
> I am new to OOP. I'm a bit confused about the following code.
>
> class Clock(object):
> def __init__(self, time):
> self.time = time
Here you set the instance attribute "self.time".
> def print_time(self):
> t
C W writes:
> I am new to OOP. I'm a bit confused about the following code.
>
> class Clock(object):
> def __init__(self, time):
> self.time = time
> def print_time(self):
> time = '6:30'
> print(self.time)
>
> clock = Clock('5:30')
> clock.print_time()
> 5:30
>
> I
"C W" wrote in message
news:cae2fw2nudjcmvukavzh01trkqeentkdxdpbawcphhsgx8jv...@mail.gmail.com...
Hello,
I am new to OOP. I'm a bit confused about the following code.
class Clock(object):
def __init__(self, time):
self.time = time
def print_time(self):
time = '6:30'
On Wed, 07 Mar 2018 16:57:51 -0500, C W wrote:
> class Clock(object):
> def __init__(self, time):
> self.time = time
> def print_time(self):
> time = '6:30'
> print(self.time)
>
> clock = Clock('5:30')
> clock.print_time()
> 5:30
>
> I set time to 6:30, but it's c
On Wed, 07 Mar 2018 16:57:51 -0500, C W wrote:
> Hello,
>
> I am new to OOP. I'm a bit confused about the following code.
>
> class Clock(object):
> def __init__(self, time):
> self.time = time
> def print_time(self):
> time = '6:30'
> print(self.time)
>
> clock
On Wed, Mar 7, 2018 at 1:57 PM, C W wrote:
> I set time to 6:30, but it's coming out to 5:30. I guess it's because I
> passed in 5:30, so, it's replaced?
time and self.time are 2 different things.
> How does line-by-line execution run inside a frame
To quickly come to grips with execution order
On 07Mar2018 16:57, C W wrote:
I am new to OOP. I'm a bit confused about the following code.
class Clock(object):
def __init__(self, time):
self.time = time
def print_time(self):
time = '6:30'
print(self.time)
clock = Clock('5:30')
clock.print_time()
5:30
I set time
On 3/7/2018 4:57 PM, C W wrote:
Hello,
I am new to OOP. I'm a bit confused about the following code.
class Clock(object):
def __init__(self, time):
self.time = time
def print_time(self):
time = '6:30'
print(self.time)
Local name 'time' is bound to '6:30'.
C W writes:
> I am new to OOP.
Welcome, and congratulations on learning Python.
> I'm a bit confused about the following code.
>
> def print_time(self):
Begins a function definition. The function will receive one argument
(the class instance), and bind the name ‘self’ to that.
>
On Wednesday, March 7, 2018 at 1:58:33 PM UTC-8, C W wrote:
> Hello,
>
> I am new to OOP.
There are (at least) two purposes for classes:
1) To group together data and functions in a meaningful way. Functions which
are defined inside a class are called methods.
2) To allow the preservation of
see clever programmer python by projects.
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
On 28 Feb 2018 21:56, wrote:
> Which sites allow you to learn interactively Python3?
>
> they can be payed,
>
> actually payed would probably be bettter
> Good quality source
> --
> https://mail
Le 15 sept. 2017 20:05, "Stefan Ram" a écrit :
When one is building an in-memory database that has a single
table that is built at the start of the program and then one
writes some complex queries to the table, what can be expected
to be faster:
- implementing the table as a builtins
Stefan Ram wrote:
> Michael Torrie writes:
>>On 09/15/2017 12:04 PM, Stefan Ram wrote:
>>>writes some complex queries to the table, what can be expected
>>^^
>>How do you plan to code these queries?
>
> I did a quick prototype. I am aware that the code
>
On Sat, Sep 16, 2017 at 11:37 AM, Steve D'Aprano
wrote:
> On Sat, 16 Sep 2017 04:24 am, Chris Angelico wrote:
>
>> but switching your dict/list system to be
>> disk-backed is a lot harder.
>
> import shelve
>
> :-)
>
>
>
> Now you have two problems :-)
>
Yeah, like: How do you do a query (anythin
On 09/15/2017 03:10 PM, Dennis Lee Bieber wrote:
> "single table" so no join logic needed. And I suspect the relational
> algebra "project" would be considered the same as SQL "select" by most
> folks
As Stefan has said, it's sometimes useful to join a table with itself,
though I have neve
1 - 100 of 1406 matches
Mail list logo