Re: This newsgroup (comp.lang.python) may soon be blocked by Google

2018-02-11 Thread alister via Python-list
On Sat, 10 Feb 2018 17:12:54 +1200, mm0fmf wrote:

> On 09/02/2018 21:05, codewiz...@gmail.com wrote:
>> On Friday, February 9, 2018 at 2:48:17 PM UTC-5, Chris Green wrote:
>>> codew...@gmail.com wrote:
 On Saturday, February 3, 2018 at 7:15:16 PM UTC-5, pyotr filipivich
 wrote:
> [snip]
>  Those of us who do not use google-groups may not notice the
>  loss
> of the google groupies.

 I use GG to read comp.lang.python because of the following
 combination of factors. I would definitely be happier if there was
 another way to do this, so that I wouldn't have to wade through lots
 of spam.

- I read it from both home and work.

- I can't install any additional software at work.

- There is no newsgroup reader software available at work.

- GG tracks read/unread status of every post. This is shared
  between work and home through my Google account.

- When I (very rarely) post from work, I can't
  do it by email, since outgoing email is blocked.

>>> Alternative approach, what I do:-
>>>
>>>  Run a text mode (but very capable and mouse aware) newsreader on
>>>  my home system, read news locally using that.
>>>
>>>  Use ssh (is that available at worK?) to connect from work to home
>>>  and run the same newsreader in the same environment. If you can't
>>>  even ssh from work then you can always use an 'ssh from the web'
>>>  app from your wenb browser.
>>>
>>> The newsreader I use is tin by the way.
>>>
>>> --
>>> Chris Green â·
>>
>> ssh would be even a bigger problem here. As I mentioned, I can't even
>> email from work to the outside! All web sites that provide remote
>> connectivity tools are blocked.
>>
>> Regards,
>> Igor.
>>
> If they take such restrictive practices then maybe should consider
> *just* doing your job when at work and leave the browsing to your own
> time?


I would also suggest that you consider the above statement ha snot been 
made out of malice but is trying to protect you.  if the restrictions are 
as strict as you say and you get seen you will probably loose your job.



-- 
Xerox does it again and again and again and ...
-- 
https://mail.python.org/mailman/listinfo/python-list


What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Victor Porton
The following is a real code fragment:

##
class PredicateParser(object, metaclass=ABCMeta):
"""
Parses a given predicate (which may participate in several 
relationships)
of a given RDF node.
"""

def __init__(self, predicate):
self.predicate = predicate

@abstractmethod
def parse(self, parse_context, graph, node):
pass
##

Now I need to add new field on_error (taking one of three enumerated values) 
to some objects of this class.

What is more pythonic?

1. Create its subclass PredicateParserWithError and add the additional field 
on_error to this class.

2. Add on_error field to the base class, setting it to None by default, if 
the class's user does not need this field.

-- 
Victor Porton - http://portonvictor.org
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread D'Arcy Cain
On 02/11/18 06:30, Victor Porton wrote:
> What is more pythonic?
> 
> 1. Create its subclass PredicateParserWithError and add the additional field 
> on_error to this class.
> 
> 2. Add on_error field to the base class, setting it to None by default, if 
> the class's user does not need this field.

Personally I would go with #1.  It just seems cleaner.  Not sure what
the Python gods would do.

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
http://www.VybeNetworks.com/
IM:da...@vex.net VoIP: sip:da...@vybenetworks.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: What is more Pythonic: subclass or adding functionality to base class?

2018-02-11 Thread Paul Moore
On 11 February 2018 at 12:55, D'Arcy Cain  wrote:
> On 02/11/18 06:30, Victor Porton wrote:
>> What is more pythonic?
>>
>> 1. Create its subclass PredicateParserWithError and add the additional field
>> on_error to this class.
>>
>> 2. Add on_error field to the base class, setting it to None by default, if
>> the class's user does not need this field.
>
> Personally I would go with #1.  It just seems cleaner.  Not sure what
> the Python gods would do.

I don't know about "Python Gods" or even what's more Pythonic, but it
might be worth commenting that if this were Java, adding a new field
to the base class would need every file that used the class to be
recompiled. So there's a tendency to subclass just to minimise the
impact of a change like this. In Python, that's not necessary, as
classes are created at runtime, and there's no compile-time layout
that code needs to depend on, so if you add an extra field to a class,
only those parts of your codebase that need the new field have to
care.

Of course, if this is a public API, backward compatibility and
versioning of the API become issues, that may affect your decision.
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: python desktop app making experience

2018-02-11 Thread Abdur-Rahmaan Janhangeer
my bad *hear

Abdur-Rahmaan Janhangeer
https://abdurrahmaanjanhangeer.wordpress.com

On 11 Feb 2018 17:05, "Abdur-Rahmaan Janhangeer" 
wrote:

> Hi all,
>
> Just can you provide your own experience of developing and shipping a
> desktop app. Did you here about such a task before etc, until years after
> story.
>
> Abdur-Rahmaan Janhangeer
> https://abdurrahmaanjanhangeer.wordpress.com
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Adding colormaps?

2018-02-11 Thread Martin Schöön
Den 2017-01-23 skrev Albert-Jan Roskam :
> (sorry for top-posting)
> I does not appear to be possible in matplolibrc (1). But you can
> use matplotlib.cm.register_cmap to register new cmaps (2) such
> as these (3).
>
> (Note: I did not try this)
>
> (1)http://matplotlib.org/1.4.0/users/customizing.html
> (2)http://matplotlib.org/api/cm_api.html
> (3)https://github.com/BIDS/colormap/blob/master/colormaps.py

More than a year later I think I can advice on the best workaround:
Use virtualenv and you can work with newer versions of Python packages
than those available in your Linux distro of base Python installation.

I am currently learning to use jupyter notebook, pandas and other
nice packages in much more recent versions than available in my Linux
distro.

I hope I can copy this onto my computer at work -- running another Linux
distro where virtualenv3 does not seem to be available.

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


python desktop app making experience

2018-02-11 Thread Abdur-Rahmaan Janhangeer
Hi all,

Just can you provide your own experience of developing and shipping a
desktop app. Did you here about such a task before etc, until years after
story.

Abdur-Rahmaan Janhangeer
https://abdurrahmaanjanhangeer.wordpress.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-11 Thread Chris Angelico
On Sun, Feb 11, 2018 at 8:52 AM, Chris Green  wrote:
> Michael F. Stemper  wrote:
>> On 2018-02-09 13:37, Chris Green wrote:
>>
>> > Alternative approach, what I do:-
>> >
>> >  Run a text mode (but very capable and mouse aware) newsreader on
>> >  my home system, read news locally using that.
>> >
>> >  Use ssh (is that available at worK?) to connect from work to home
>>
>> Your ISP provides that capability? I'm surprised. I'm with Charter and
>> the only external IP address is for the cable modem (I think).
>> "icanhazip" shows the same one, no matter which computer I use.
>>
> You use the same external IP address, just use the right port number
> (which you set up your router to allow in).
>

Exactly. The easiest way is to set up port forwarding in your cable
modem. Any device worth using should have at least SOME measure of
port forwarding. Of course, if your ISP offers an IPv6 netblock, it's
easy.

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


Re: This newsgroup (comp.lang.python) may soon be blocked by Google Gro

2018-02-11 Thread Michael F. Stemper

On 2018-02-09 13:37, Chris Green wrote:


Alternative approach, what I do:-

 Run a text mode (but very capable and mouse aware) newsreader on
 my home system, read news locally using that.

 Use ssh (is that available at worK?) to connect from work to home


Your ISP provides that capability? I'm surprised. I'm with Charter and
the only external IP address is for the cable modem (I think).
"icanhazip" shows the same one, no matter which computer I use.

--
Michael F. Stemper
Psalm 94:3-6
--
https://mail.python.org/mailman/listinfo/python-list