Most elegant way to do something N times

2019-12-22 Thread Batuhan Taskaya
I encounter with cases like doing a function 6 time with no argument, or
same arguments over and over or doing some structral thing N times and I
dont know how elegant I can express that to the code. I dont know why but I
dont like this for _ in range(n): do() thing. Any suggestions?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: python 8.0

2019-10-25 Thread Batuhan Taskaya
> but python is only up to version 3.8
He probably meant 3.8.0 but there was a python 8 (as an april 1 joke by
victor stinner)
https://mail.python.org/archives/list/python-...@python.org/thread/4P46WYJTZUKJ2EABQSASI7CD643YY5QL/

On Fri, Oct 25, 2019, 6:32 PM Gene Heskett  wrote:

> On Friday 25 October 2019 02:35:06 Ebuka Amadi wrote:
>
> > -- Forwarded message -
> > From: Ebuka Amadi 
> > Date: Thu, 24 Oct 2019 at 22:31
> > Subject: python 8.0
> > To: 
> >
> >
> > Dear team i downloaded python 8.0 am finding it hard to install it i
> > hope to get a step by stem instructions to do this on my PC its a core
> > i5
>
> I am just a lurker here, but python is only up to version 3.8. If that is
> python 8, I would wipe it off the system and go get the real thing from
> a genuine python site.  If you paid for it (its free), take whatever
> actions you have to, to get your money back.
>
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> If we desire respect for the law, we must first make the law respectable.
>  - Louis D. Brandeis
> Genes Web page 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Any bad patterns we can find with static analyzing

2019-08-05 Thread Batuhan Taskaya
I am developing a project called Inspector Tiger (from monty python
:)) and with that project i am trying to perform a static check over
the source code to find common mistakes. If you know a common mistaken
pattern, it would be really great to share it with me or implement it
and PR to inspector tiger.

Source: https://github.com/thg-consulting/inspectortiger
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Is there a simple way to wrap a built-in function for the whole package?

2019-08-02 Thread Batuhan Taskaya
functools.partial is a better option

On Fri, Aug 2, 2019, 1:25 AM Cameron Simpson  wrote:

> On 31Jul2019 19:16, Jach Fong  wrote:
> >I get a package from Pypi. The package has many modules using built-in
> open() function. I like to redefine all the open() there with the default
> encoding 'utf-8', but not for code outside the package. Maybe I can put my
> def statement at the beginning of every module of this package, but just
> wondering is there a simple way of doing it?
>
> I would define something like this in the __init__.py file of the
> package (or in some utils.py file in the package):
>
>   def open8(path):
> return open(path, encoding='utf-8')
>
> and just:
>
>   from . import open8
>
> and use "open8" throughout the code instead of "open"?
>
> What not alias "open"? Because I would want it evident that in this code
> we're doing a slightly special flavour of open. By using a distinct name
> I avoid confusion about the unusual semantics.
>
> Cheers,
> Cameron Simpson 
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list